Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Group only gear on spawn breaks once respawned Help?

Asked by 10 years ago

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)

0
Try waiting a bit before adding the tool. wazap 100 — 10y

2 answers

Log in to vote
1
Answered by
TopDev 0
10 years ago

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)
Ad
Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

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)
0
Wrong, fireboltofdeath 635 — 10y

Answer this question