Set weapon/item player is holding

How do I set the weapon the player is holding, but first check to make sure the player has the weapon?


Checks for item >> True >> Makes player hold item
>> False >> Writes to console then returns

local weapon = “weapon_ak47”

concommand.Add(“weaponcheck”, function( ply )
if ply:HasWeapon( weapon ) then
ply:SelectWeapon( weapon )
end )

Awesome thanks!

Why do you wanna hide the code from others ?

You didnt make it, so that’s just weak.

Anyways, we can see it in his post, so…

I think it was just about cutting down the size of the quote.

meh, why quote it then?

God, why did you make me come back here? This topic is over. I qouted it, so he knew I was talking to him (he’d be dumb to think I wasn’t though) and I just wanted to save space, does it really matter? You thought I was trying to steal the code or something?

The code disappeared from my browser, but no worries, I just grabbed it from the HTML. I don’t know why it’s hidden from me.

Internet Explore breaks [lua] tags.