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

Group Rank Tool script isn't adding tool to the player inventory on spawn?

The tool is in ServerStorage, I believe the fault is at the end where it finds the ranks needed.


local groupId = 6998516
local tool = game.ServerStorage['Cleaning Equipment']
function onPlayerSpawned(player)
	if player:IsIngroup(groupId) then 
		tool:Clone().Parent = player.Backpack
	end
end

game.Players.PlayerAdded:connect(function(player)
  player.CharacterAdded:connect(function()
    onPlayerSpawned(player)
  end)
end)

function onPlayerSpawned(player)
  if player:GetRankInGroup(groupId) = {252,253,254,255} then
    tool:Clone().Parent = player.Backpack
  end
end

1 answer

✓ Accepted answer
function onPlayerSpawned(player)
local roleids = {252,253,254,255}
for i,v in pairs(roleids) do
if player:GetRankInGroup(groupId) == v then
tool:Clone().Parent = player.Backpack
end
end
end

Also, put the function before the playeradded function. Hope this helps

1 comment

0

Got it! Thanks!

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