local plr = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
local character = game.Workspace:WaitForChild(plr.Name)
if plr.Name == "aprilsfooled" then
print (plr.Name .. " , has spawned")
local t = game.ServerStorage.Tools.Keycard:Clone()
t.Parent = plr.Backpack
end
end)
✓ ANSWER ACCEPTED
How to modify it so that the tool is given again, after resetting/respawning?
2 answers
✓ Accepted answer
CharacterAdded I believe fires on a respawn and on join.
Ex.
local Name = "aprilsfooled"
game.Players[Name].CharacterAdded:Connect(function()
-- your code --
end)
local Players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(character)
if plr.Name == "yourinvolvedplayer" then
print (plr.Name .. " , has spawned")
local t = game.ServerStorage.Tools.Keycard:Clone()
t.Parent = plr.Backpack
end
end)
end)
I got it fixed. Thanks for the help though.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Just want to know that you don’t have to do game.Players[plr.Name] when par has already been given to you. Also, there is no need to check for the player’s name, the connection is only for the given player.
@ankurbohra04 That is correct, I don't know what I was thinking. I'll fix the code.
@Benbebop aprilsfooled is not a valid member of Players
@aprilsfooled make sure that the name is exacly the same as your roblox name. If that doesnt work, run a test and look in the players then copy the name of your client. Paste it there and try it again.