Hello,
I am trying to make it so that when a player says a specific phrase they are given a tool which comes from ServerStorage.
So far this is my script.
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg, recipient, speaker)
if string.lower(msg) == "test" then -- checks if the message was test being not capital specific
local toolClone = game.ServerStorage["Gold Key"]:Clone() -- Directory to tool and then clones it
toolClone.Parent = speaker.Backpack -- Puts clone into backpack (this is where the error is coming from)
end
end)
end)
In it's current state when a player says "test" an error appears saying attempt to index nil with 'Backpack.
How would I go about fixing this issue?

1 comment
I didn't even think of that, thank you so much!