I have a localscript and it is supposed to toggle visibility when a player reaches certain leaderstats. However, when one player reaches the stats, the whole server gets the visibility toggled. I'm a bit new to scripting so I'm not sure where I went wrong.
while true do
for i,v in pairs(game.Players:GetChildren()) do
if v.leaderstats.Level.Value >= 2 then
script.Parent.Main.Archer.Visible = true
script.Parent.Covers.ArcherCover.Visible = false
script.Parent.Frame.Archer.Visible = true
end
if v.leaderstats.Level.Value >= 3 then
script.Parent.Main.Skeleton.Visible = true
script.Parent.Covers.SkeletonCover.Visible = false
script.Parent.Frame.Skeleton.Visible = true
end
if v.leaderstats.Level.Value >= 4 then
script.Parent.Main.LavaBaron.Visible = true
script.Parent.Covers.LavaBaronCover.Visible = false
script.Parent.Frame.LavaBaron.Visible = true
end
if v.leaderstats.Level.Value >= 5 then
script.Parent.Main.Pikeman.Visible = true
script.Parent.Covers.PikemanCover.Visible = false
script.Parent.Frame.Pikeman.Visible = true
end
end
wait(1)
end
