Code is pretty self-explanatory, checking if localplayer is a member of the group above a certain rank, and if they are the click detector for the player specifically will have the max activation distance of 12 and if the player is not in the group the activation distance for them is 0. Not working properly, I think the issue is trying to get the localplayer, but that is just a guess.
local player = game.Players.LocalPlayer
if player:GetRankInGroup(9763233) >= 25 then
script.Parent.MaxActivationDistance = 12
else
script.Parent.MaxActivationDistance = 0
end
I’m erm, looking at this here and I don’t think you can do it like that
So you’d need to put that LocalScript somewhere else (In StarterPack preferably) and define the ClickDetector/ProximityPrompt as well:
local Player = game.Players.LocalPlayer
local Something = workspace.ClickDetector
if Player:GetRankInGroup(9763233) >= 25 then
Something.MaxActivationDistance = 12
else
Something.MaxActivationDistance = 0
end
game.Players.PlayerAdded:Connect(function(player)
if player:GetRankInGroup(9763233) >= 25 then
script.Parent.MaxActivationDistance = 12
else
script.Parent.MaxActivationDistance = 0
end
end)
What’s the purpose of this? The point here is that the ClickDetector shouldn’t be clickable for those not above the Rankid of 25. There’s no point of the PlayerAdded if it’s local and if it’s server it won’t work for everyone.