I get an error in my script on line 5 { attempt to index local 'player' (a nil value) } I also don't get the error in a studio test , but only in the game itself.
GroupID = 4318939 wait(2) local player = game.Players.LocalPlayer -- (error here) if player:IsInGroup(GroupID) and player:GetRankInGroup(GroupID) == 255 then local ULTI = game:GetService("ReplicatedStorage").ULTI:GetChildren() for i=1, #ULTI do if ULTI[i]:IsA("Tool") then ULTI[i].Parent = player.Backpack local x = ULTI[i]:Clone() x.Parent = player.StarterGear end end end
local GroupID = 4318939 wait(2) game.Players.PlayerAdded:connect(function(player) --Don't use localplayer. It only works because when you start a test, you are the client and the server. You could do something like this ^ if player:IsInGroup(GroupID) and player:GetRankInGroup(GroupID) == 255 then local ULTI = game:GetService("ReplicatedStorage").ULTI:GetChildren() for i=1, #ULTI do if ULTI[i]:IsA("Tool") then ULTI[i].Parent = player.Backpack local x = ULTI[i]:Clone() x.Parent = player.StarterGear end end end)