Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Group only gear on spawn breaks once respawned Help?

Ok so, it works the first time you join the game, but the tools will break once you are respawned.

help? Current script:

game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function() RN = p:GetRankInGroup("group id here") if RN == 5 then --Change 5 to the rank game.Lighting.Operator:Clone().Parent = p.Backpack end end) end)

1 comment

0

Try waiting a bit before adding the tool.

2 answers

Try this.

groupid = 1
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:wait()
RN = p:GetRankInGroup(groupid)
if RN == 5 then
game.Lighting.Operator:clone().Parent = player.Backpack
game.Lighting.Operator:clone().Parent = player.StarterGear
end
end)

First of all, you need the group ID. For the backpack, it might not have loaded fully, so use the wait for child method there it will wait until backpack shows.

Edit; the group Id shouldn't be in quotes.

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function()
RN = p:GetRankInGroup(group id here) --PUT GROUP ID HERE.
if RN == 5 then --Is this your rank in the group? If not, you won't get the tools.
game.Lighting.Operator:Clone().Parent = p:WaitForChild("Backpack")
end
end)
end)

1 comment

0

Wrong,

This discussion is preserved as it was. New answers, comments, and votes are closed.