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

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

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

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.

3 comments

0

The script does NOT work

1

What do you mean? Can you update your question with the code you have right now?

0

He is trying to teach you how to do it, not give you the script...

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