Let's say, there is a tool for rank 250 and up, how would I make it that way? I do not have a script for it as I do not know any way to make a script like that. Any suggestions?
game.Players.PlayerAdded:Connect(function(plr) if plr:GetRoleInGroup(4731512) >= 250 then game.ServerStorage.Badge:Clone().Parent = plr.Backpack end end)
Let's take a step back here. This code doesn't even compile.
You have a syntax mistake here:
if plr:GetRoleInGroup(4731512) == 250>= then
>=
is a binary operator, meaning it takes 2 operands.
You're missing an operand, however your intention is to see if their rank is 250 or higher
.
Let's fix that.
if plr:GetRoleInGroup(4731512) >= 250 then
Second issue is this
game.Lighting["Administration Badge"]:Clone() game.Lighting["Administration Badge"].Parent = plr.Backpack
You're creating a clone but you're not parenting the clone. You're parenting the original item.
Also, do not use Lighting
as storage. It is not intended for storage, we have ServerStorage
and ReplicatedStorage
. There is no reason to use Lighting
for this.
game.ServerStorage["Administration Badge"]:Clone().Parent = plr.Backpack
There we go! This code should work now.