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

Certain rank and above in a group-only button?

I need a button where only people above a certain rank in a certain group can make the function work.

function Play()
	script.Parent.Parent.Speaker.Sound:Play()
wait(40.6)
script.Parent.Parent.Speaker.Sound:Stop()

end
script.Parent.ClickDetector.MouseClick:connect(Play)

This is the script for the "Staff only" bit ive come up with

if plr:GetRankInGroup(5280317) >= 100 then

I doubt this is right, but i dont know what do to from here, i dont know where in the function to put that script.

1 answer

✓ Accepted answer

So basically, all you want to do is to connect the function to the player pressing the button and then using an if statement.

local sound = script.Parent.Parent.Speaker.Sound

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	if player:GetRankInGroup(5280317) >= 100 then
		sound:Play()
		wait(40.6)
		sound:Stop()
	end
end)

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