Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Give LIghting Gear script?

Asked by
narfh 0
8 years ago

So I tried to make a Simple give script so when you say give/NC nc is a gear in lighting and I cant get it to do that... Can you guys help? ~~~~~~~~~~~~~~~~~ game.Players.PlayerAdded:connect(function(plyr) if plyr == "narfh" then plyr.Chatted:connect(function(chatmessage) local command = {"give/NC"} _, _, filter, receiver, gift = string.find(chatmessage, "(give/)(%w/)(%w)") table.insert(command, filter); table.insert(command, receiver); table.insert(command, gift) if #command == 3 and command[1] == "give/" then local player = command[2]:sub(1, (command[2]:len() - 1)) local tool = command[3] if game.Players:FindFirstChild(player) and game.Lighting:FindFirstChild(tool) then game.Lighting[tool]:Clone().Parent = game.Players[player].Backpack end end end) end end) ~~~~~~~~~~~~~~~~~

0
In codeBlock please XToonLinkX123 580 — 8y

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
8 years ago

You need to put that code in a code block, but I did notice a problem right off the bat. You said

if plyr == "narfh"

but a Player will never, ever equal a string. It is its own object. You probably meant to get the player's name.

if plyr.Name == "narfh"
Ad

Answer this question