how do i add like a sword to my starter pack to where only certain players can get it
A PlayerAdded and CharacterAdded events are needed to do this. Script
game.Players.PlayerAdded:connect(function(plr) -- playeradded event identifying the player that joined as "plr" plr.CharacterAdded:connect(function(char) -- characteradded event, identifying the plr's character that respawned as "char" if plr.Name == "NameHere" then -- Change "NameHere" to the player that has the permission to have the tool. local tool = game.ServerStorage.Tool:Clone() -- cloning the tool from serverstorage, change this to your parenting local backpack = plr:findFirstChild("Backpack") -- getting the player's backpack if backpack then -- checking if the backpack exists to prevent possible errors(not necessary) tool.Parent = backpack -- parenting it to their backpack. end end end) end)
Full Script:
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) if plr.Name == "NameHere" then local tool = game.ServerStorage.Tool:Clone() local backpack = plr:findFirstChild("Backpack") if backpack then tool.Parent = backpack end end end) end)
Hope it helped!
game.Players.PlayerAdded:connect(function(plr) -- playeradded event identifying the player that joined as "plr" plr.CharacterAdded:connect(function(char) -- characteradded event, identifying the plr's character that respawned as "char" if plr.Name == "ags5321" then -- Change "NameHere" to the player that has the permission to have the tool. local tool = game.ServerStorage:Clone("Card1") -- cloning the tool from serverstorage, change this to your parenting local backpack = plr:findFirstChild("Backpack") -- getting the player's backpack if backpack then -- checking if the backpack exists to prevent possible errors(not necessary) tool.Parent = backpack -- parenting it to their backpack. end end end) end)
is that it