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.
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)