Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why does my tween have this weird effect to the "alert" TextLabel?

Asked by 5 years ago

When the text gets tweened it has a weird stuttery or twitching effect to it (if you look very closely)

Is there any possible way to fix this?

Hierarchy and GIF Image

Script:

while true do
    if game.Workspace.severethunderstormwatch.Value == true then
        local pos = script.Parent.alert.Position 
        script.Parent.TextLabel.Text = " "
        script.Parent.randomtext.Disabled = true
        script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County"
        script.Parent.alert:TweenPosition(UDim2.new(-1.6,0,0,0), "In", "Linear", 16)
        wait(16)
        script.Parent.alert:TweenPosition(pos, "In", "Linear", 0)
        script.Parent.randomtext.Disabled = false
    wait(0.1)
end
0
You have missed the end at the end of the script. narrowricky -14 — 5y
0
its because you never broke or set the condition to false, so it tweens the GUI every 0.1 seconds constantly; making that effect User#23365 30 — 5y
0
If you’ve going to Index the Scripts Parent so much, make a Variable Ziffixture 6913 — 5y

2 answers

Log in to vote
1
Answered by
Bertox 159
5 years ago

Hi, instead of using a loop you should use this event .Changed It fires then the Value got changed. That also should fix your error, it stutters because you use a loop and it keeps Tweening every 0.1 seconds

function Alert()
    if game.Workspace.severethunderstormwatch.Value == true then
        local pos = script.Parent.alert.Position 
        script.Parent.TextLabel.Text = " "
        script.Parent.randomtext.Disabled = true
        script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County"
        script.Parent.alert:TweenPosition(UDim2.new(-1.6,0,0,0), "In", "Linear", 16)
        wait(16)
        script.Parent.alert:TweenPosition(pos, "In", "Linear", 0)
        script.Parent.randomtext.Disabled = false
    end
end

game.Workspace.severethunderstormwatch.Changed:Connect(Alert)

I am not a good scripter but I try to help

0
Doesnt work either. It still stutters. Edit: It seem to have been "TextScaled" causing the stutter effect, but im gonna accept this anyways as appreciation to your contribution. LoganboyInCO 150 — 5y
0
Ok thank you :D Bertox 159 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

You have put the end in the wrong place and the wait you should put it like this

while true do
    if game.Workspace.severethunderstormwatch.Value == true then
        local pos = script.Parent.alert.Position 
        script.Parent.TextLabel.Text = " "
        script.Parent.randomtext.Disabled = true
        script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County"
        script.Parent.alert:TweenPosition(UDim2.new(-1.6,0,0,0), "In", "Linear", 16)
        wait(16)
        script.Parent.alert:TweenPosition(pos, "In", "Linear", 0)
        script.Parent.randomtext.Disabled = false

end
wait(0.1)
end
0
Doesn't work at all. LoganboyInCO 150 — 5y

Answer this question