So i have a code which basically makes the ui change for only certain levels, here:
- Below is the image of example level 1-10 and then level 11
So as you see, it works pretty well but unfortunately there is a problem, when i try to add another level, [example:12] it doesn’t work.
I will attack the code below.
> local player = game.Players.LocalPlayer
> local Exp = player:FindFirstChild("Data"):WaitForChild("Exp")
> local Levels = player:FindFirstChild("Data"):WaitForChild("Levels")
> local VS = require(game:GetService("ReplicatedStorage").Game.Modules:WaitForChild("EasyVisuals"))
>
> Exp.Changed:Connect(function()
> script.Parent.Text = ""..Exp.Value.."/".. tostring(100 * (Levels.Value + 1))
> end)
>
> Levels.Changed:Connect(function()
> if Levels.Value == 11 then
> script.Parent.Text = "Max Level"
> VS.new(script.Parent, "IceStroke", 1, 1)
> VS.new(script.Parent.Parent.Decore, "IceStroke", 1, 1)
> VS.new(script.Parent.Parent.Parent.Background, "IceStroke", 1, 1)
> VS.new(script.Parent.Parent.Level, "IceStroke", 1, 1)
> --script.Parent.Parent.Level.UIGradient.Enabled = true
> else
> script.Parent.Text = ""..Exp.Value.."/".. tostring(100 * (Levels.Value + 1))
> VS.new(script.Parent.Parent.Parent.Parent.LevelUp.TextLabel, "Rainbow", 1, 1)
> VS.new(script.Parent.Parent.Parent.Parent.LevelUp.ImageLabel, "Rainbow", 1, 1)
> end
> end)
>
> if Levels.Value == 11 then
> script.Parent.Text = "Max Level"
> VS.new(script.Parent, "IceStroke", 1, 1)
> VS.new(script.Parent.Parent.Decore, "IceStroke", 1, 1)
> VS.new(script.Parent.Parent.Parent.Background, "IceStroke", 1, 1)
> VS.new(script.Parent.Parent.Level, "IceStroke", 1, 1)
> --script.Parent.Parent.Level.UIGradient.Enabled = true
> else
> script.Parent.Text = ""..Exp.Value.."/".. tostring(100 * (Levels.Value + 1))
> VS.new(script.Parent.Parent.Parent.Parent.LevelUp.TextLabel, "Rainbow", 1, 1)
> VS.new(script.Parent.Parent.Parent.Parent.LevelUp.ImageLabel, "Rainbow", 1, 1)
> end
Thank you so much.