I am trying to make it so the gamepass tool respawns with the person after they die instead of just when they join so it doesnt disappear.
--Created By Sunstaff
wait(2) --Keep at 2 for safety.
------EDIT BELOW
gpid = 324342064 --Game Pass ID
tools = {"Javelin"} --Put VIP tools in Lighting, then put their exact names here.
------ DON'T EDIT BELOW UNLESS YOU KNOW WHAT YOU'RE DOING
GPS = Game:GetService("GamePassService")
function respawned(char)
player = game.Players:FindFirstChild(char.Name)
print("Respawned")
if char:FindFirstChild("Head") ~= nil then
print("It's a Player!")
if GPS:PlayerHasPass(player, gpid) then
print("Has GPID")
for i = 1,#tools do
game.Lighting:FindFirstChild(tools[i]).Parent = player.Backpack
end
else
print("No GPID")
end
end
end
game.Workspace.ChildAdded:connect(respawned)
|