• Need help with pointshop item holster/equip script
    4 replies, posted
I've been working on this for a few hours, i'm very new to lua and i'm stumped on this. I'm trying to make a script that holsters/equips an item from pointshop. So far i've been able to get it working, but for specific items only. concommand.Add("toggleitem", function(ply) if(ply:PS_HasItemEquipped('supersmall'))then ply:PS_HolsterItem('supersmall') else ply:PS_EquipItem('supersmall') end end) What i want to do is use the word after the command as the item name, so one can easily use it for all items. This is what i tried to do but i don't really understand it and am just stabbing in the dark. concommand.Add("toggleitem", function(ply, cmd, args, str) if(ply:PS_HasItemEquipped("'"str"'"))then ply:PS_HolsterItem("'"str"'") else ply:PS_EquipItem("'"str"'") end end) So in-game i want to type my command, followed by the script name (item_id) of the item i want to equip/holster. https://files.facepunch.com/forum/upload/241341/4479fb54-01ff-4b75-8717-bf630d18eef5/image.png Thanks in advance ;)
I’m not familiar with pointshop, but I’m also not familiar with “‘“ Have you tried just putting str in the parentheses?
Start by giving the error, and have you tried it? We can break it down from there.
Uhm, this? ("'"str"'") What are you trying to do? Just pass the string. PS_HasItemEquipped(str)
Oh okay! Thanks that worked! I thought i tried it before but it must have been when i was testing for the args
Sorry, you need to Log In to post a reply to this thread.