ive tried everything but everything returned NILL
get Players weapon?
Moderator: Moderators
get Players weapon?
Hey, is it possible to detect what weapon or what weapon class/type is being used?
ive tried everything but everything returned NILL
ive tried everything but everything returned NILL
There's several ways, this is probably the easiest:
Do not execute a weaponcommand each frame though, they will stack and cause major lag after about a minute or so.
Code: Select all
local.randomnum = randomint 1000
local.player weaponcommand dual targetname local.randomnum
local.thisplayersweapon = entity local.randomnum // or $(local.randomnum)
local.thisplayersweapon targetname "" // clear targetname
Well that's probably true At0mic
Another way would be this:
And then in main somescript.scr have:
Another way would be this:
Code: Select all
parm.weapplayer = local.player
local.player weaponcommand dual exec somescript.scr
local.weapon = local.player.lastdetectedweapon
Code: Select all
main:
parm.weapplayer.lastdetectedweapon = self
end
