That’s weird. Is it in a script or localscript?
Try this, also it’s in a localscript located in StarterPlayerScripts
local Player = game.Players.LocalPlayer
local RequiredRanks = {"Rank2"}
local Barrier = game.Workspace:FindFirstChild("Rank1_Barrier")
local leaderstats1 = Player:WaitForChild("leaderstats")
local Rank = leaderstats1.Rank
local function DestroyBarrier()
if Barrier and table.find(RequiredRanks,Rank.Value) then
Barrier:Destroy()
end
end
Rank.Changed:Connect(function()
DestroyBarrier()
end)
DestroyBarrier()
2 Likes
Did this solution work for you?
Roblox studio was bugging for me, sorry it took so long. Trying it now.
I changed it to local Rank = leaderstats1.Rank2 and it works now. Thank you so much!