Use a LocalScript
instead of a script. This makes thing much easier for you. All you need to do is to create a LocalScript inside either in the StarterPack
or StarterPlayer>StarterPlayerScripts
, which ever one you prefer.
Also I changed your script:
1 | for i,v in pairs (game.Players:GetChildren()) do |
Instead of a for loop. You can do this instead.
01 | local v = game.Players.LocalPlayer |
04 | if v.leaderstats.Level.Value > = 2 then |
05 | script.Parent.Main.Archer.Visible = true |
06 | script.Parent.Covers.ArcherCover.Visible = false |
07 | script.Parent.Frame.Archer.Visible = true |
09 | if v.leaderstats.Level.Value > = 3 then |
10 | script.Parent.Main.Skeleton.Visible = true |
11 | script.Parent.Covers.SkeletonCover.Visible = false |
12 | script.Parent.Frame.Skeleton.Visible = true |
14 | if v.leaderstats.Level.Value > = 4 then |
15 | script.Parent.Main.LavaBaron.Visible = true |
16 | script.Parent.Covers.LavaBaronCover.Visible = false |
17 | script.Parent.Frame.LavaBaron.Visible = true |
19 | if v.leaderstats.Level.Value > = 5 then |
20 | script.Parent.Main.Pikeman.Visible = true |
21 | script.Parent.Covers.PikemanCover.Visible = false |
22 | script.Parent.Frame.Pikeman.Visible = true |
Just copy and paste this code into the LocalScript you created. I hope this worked for you.