Hello!
I have this script, which deletes a button and frame inside the GUI if the person is either:
- Not high enough rank OR
- Is a high enough rank, but does not have permission to click on the button.
I want this to work so that when a player resets, it still works and this is why I've put this script inside StarterPark.
plr = script.Parent.Parent.Name
local b = plr:GetRankInGroup(1096916)
if b == 200 then
script.Handbook.Frame.Menu.DTProc:Destroy()
script.Handbook.Frame.DTTrainProc:Destroy()
end
if plr.GetRankInGroup(1096916) < 150 then
script.Handbook.Frame.Menu.DTProc:Destroy()
script.Handbook.Frame.DTTrainProc:Destroy()
end
local a = script.Handbook:Clone()
a.Parent = script.Parent.Parent.PlayerGui
script:Destroy()
However, when this does run I get some sort of nil value error. Anyone know what's this about?
EDIT: The error is:
01:36:01.711 - Players.Player.Backpack.Script:4: attempt to call method 'GetRankInGroup' (a nil value)

2 comments
Please post the error.
Added.