Just like the title says, once the Player Gets EXP, The Gui Is Susspose to tween, but for some reason, The Player Gets EXP, But the gui does not tween, How can I fix this?
while wait() do local XP = Player.Data.StrengthEXP.Value local MaxXP = Player.Data.Strength.Value*150 local math = ( XP / MaxXP ) script.Parent.Parent:TweenSize(UDim2.new(math,0,1,0),"Out","Quad",.25) end
And Also, the game is filtering enabled, so i dont need to F.E this, since it's Happening on the Players Screen Only.
A few things are wrong with your code. First of all you are using a loop, this is costly on the performance and it would be way better if you had a .Changed function refresh the bar. Also, I am assuming this is your whole script, you need to wait for the stats to load in, or else it will not work in a real game. THE MAIN PROBLEM I believe is that you are using the variable named "math" which you shouldn't do, when you type it in in script editor it turns blue, that means it has a use that does something else and you can not name it math, or else it will get confused. This is what your script should look like
local Player = game.Players.LocalPlayer local str = Player:WaitForChild("Data"):WaitForChild("Strength") local xp = Player:WaitForChild("Data"):WaitForChild("StrengthEXP") function refresh() local maxExp = str.Value*150 local x = x.pValue/maxExp script.Parent.Parent:TweenSize(UDim2.new(x,0,1,0),"Out","Quad",.25) end refresh() str.Changed:connect(refresh) xp.Changed:connect(refresh)