Why is this not working? I have a folder called Tools in replicated storage. My gamepass script has a intvalue called GamePassId.
local gamepass = script:WaitForChild("GamePassId")
local service = game:GetService("GamePassService")
local tools = game.ReplicatedStorage:WaitForChild()
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)
