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

How would I make a gear for a certain rank in group and up?

Asked by 4 years ago
Edited 4 years ago

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)

1 answer

Log in to vote
0
Answered by 4 years ago

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.

0
The script does NOT work C0nn0r_DevCT 42 — 4y
1
What do you mean? Can you update your question with the code you have right now? BashGuy10 384 — 4y
0
He is trying to teach you how to do it, not give you the script... Robowon1 323 — 4y
Ad

Answer this question