![]() |
Button Gui For Weapons
basically i want to make a button that has player.weapon.name so whatever weapon you have selected if its on weapon fired activated it would be equipable to the button gui then then the button is pressed it finds the players current weapon and fires it.
lets take for example. iv scripted an ak47 i could easily script the box to drop it into but how would i make the button actually do onweaponfired on the current weapon? if anyone has any suggestions there much appriciated. thanks. |
PS: Im not asking for scripts/Script begging.
id just like to know the basics of what id have to do to accomplish this. |
You can trigger the player's currently selected weapon with:
player.weapon.trigger("WeaponFired", ""); |
wow, that was incredibly easy. i feel so dumb.
is there any way to check if the weapon the player is trying to set as a button has onWeaponFired(){ in it to see if its allowed to be equiped or not? thanks. now i just need to script dragging of weapons to slots x_x Quote:
iv tested around with it and its brilliant! Edit: shouldnt it have to be player.weapon.name.trigger? |
Quote:
PHP Code:
if (player.weapon.itemtype == "weapon") { else where. Quote:
Quote:
You can get weapon objects by using findweapon or referencing the object directly. I.e: For -System findweapon("-System") or (@"-System") both would refer to the -System weapon object. Direct referencing is more efficient but using findweapon is alright too. |
| All times are GMT +2. The time now is 10:56 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.