local gamepass = script:WaitForChild("GamePassId") local service = game:GetService("GamePassService") game.Players.PlayerAdded:connect(function(player) if service:PlayerHasPass(player,gamepass.Value) then local tools = game.ReplicatedStorage:WaitForChild("Tools") for i,v in pairs(tools:GetChildren()) do if v:isA("Tool") then v:Clone().Parent = player:WaitForChild("Backpack") v:Clone().Parent = player.WaitForChild("StarterGear") end end end end)
I think the PlayerAdded event will fire when you die somehow. To prevent this insert a BoolValue in the charachter.
local gamepass = script:WaitForChild("GamePassId") local service = game:GetService("GamePassService") game.Players.PlayerAdded:connect(function(player) if service:PlayerHasPass(player,gamepass.Value) then local tools = game.ReplicatedStorage:WaitForChild("Tools") for i,v in pairs(tools:GetChildren()) do local boolvalue = Instance.new("BoolValue",player) if v:isA("Tool") and not boolvalue then v:Clone().Parent = player:WaitForChild("Backpack") v:Clone().Parent = player.WaitForChild("StarterGear") boolvalue.Value = true end end end end)
If this helps you let me know im not that good in scripting :)
local gamepass = script:WaitForChild("GamePassId") local service = game:GetService("GamePassService") game.Players.PlayerAdded:connect(function(player) if service:PlayerHasPass(player,gamepass.Value) then local tools = game.ReplicatedStorage:WaitForChild("Tools") for i,v in pairs(tools:GetChildren()) do if v:isA("Tool") then v:Clone().Parent = player:WaitForChild("Backpack") v:Clone().Parent = player.WaitForChild("StarterGear") -- You have a period instead of a colon player.WaitForChild end end end end)
Hope this helps <3