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

Gear Lighting Script?

Asked by
narfh 0
8 years ago
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)

I can't seem to figure this out, I want it to give me a gear that's called NC but when I'm in game it wont work can you help me?

3
I give up, I can't read it. woodengop 1134 — 8y
0
Guys you can't read the scripts becuase your not that avanced so don't dislike it becuase you can't read the script it says dislike it if you can't undertand the question... narfh 0 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
game.Players.PlayerAdded:connect(function(plyr) if plyr.Name == "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)

I must admit, it was hard to read, but I found the problem immediately. You tried to check if the player object was Narfh, but it's not. The Name of the player object is Narfh.

Ad

Answer this question