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?
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.