Here's my script;
local plr = game.Players.LocalPlayer local SB = script.Parent:WaitForChild('StartButton') local OI = script.Parent:WaitForChild('OrangeImage') local OT = script.Parent:WaitForChild('OrangeText') local CB = script.Parent:WaitForChild('CombatHeros') local String = CB.WTS.Value local Length = string.len(String) OI:TweenPosition(UDim2.new(0.3, 0,0.4, 0),'In','Bounce',4) OT:TweenPosition(UDim2.new(0.45, 0,0.39, 0),'In','Sine',2) SB:TweenPosition(UDim2.new(0.53, 0,0.75, 0),'In','Bounce',1) for i = 1, Length do CB.Text = string.sub(String,1,i) wait(0.3) end
The Tween Doesn't work and goes straight to the loop. How come it doesn't tween? Is there a way to fix it? This is a local script inside a screen GUI. Should I add game.Player.PlayerAdded:Connect(function()
? I'm not sure. I want this to run when the player joins. This is like an intro GUI.
Please answer with examples so I can understand.
Thank you for reading
I tested your script (using random gui objects) and it tweens just fine. I assume your problem is what SpyGuyTBM guessed - that you want the for
loop to run after the tweens are done. You can either follow SpyGuyTBM's advice and add wait
commands or make use of TweenPosition's callback function, like so:
OI:TweenPosition(UDim2.new(0.3, 0,0.4, 0),'In','Bounce',4, function() OT:TweenPosition(UDim2.new(0.45, 0,0.39, 0),'In','Sine',2, function() --etc end) end)
There are more elegant solutions, but they're more complicated.
If your problem is that you don't see any Tweening at all, make sure that you're seeing the same gui objects that your script is modifying. (ex, maybe they're modifying a duplicate that isn't even Visible, or is behind some other gui?)