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?
Script:
01 | while true do |
02 | if game.Workspace.severethunderstormwatch.Value = = true then |
03 | local pos = script.Parent.alert.Position |
04 | script.Parent.TextLabel.Text = " " |
05 | script.Parent.randomtext.Disabled = true |
06 | script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County" |
07 | script.Parent.alert:TweenPosition(UDim 2. new(- 1.6 , 0 , 0 , 0 ), "In" , "Linear" , 16 ) |
08 | wait( 16 ) |
09 | script.Parent.alert:TweenPosition(pos, "In" , "Linear" , 0 ) |
10 | script.Parent.randomtext.Disabled = false |
11 | wait( 0.1 ) |
12 | end |
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
01 | function Alert() |
02 | if game.Workspace.severethunderstormwatch.Value = = true then |
03 | local pos = script.Parent.alert.Position |
04 | script.Parent.TextLabel.Text = " " |
05 | script.Parent.randomtext.Disabled = true |
06 | script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County" |
07 | script.Parent.alert:TweenPosition(UDim 2. new(- 1.6 , 0 , 0 , 0 ), "In" , "Linear" , 16 ) |
08 | wait( 16 ) |
09 | script.Parent.alert:TweenPosition(pos, "In" , "Linear" , 0 ) |
10 | script.Parent.randomtext.Disabled = false |
11 | end |
12 | end |
13 |
14 | game.Workspace.severethunderstormwatch.Changed:Connect(Alert) |
I am not a good scripter but I try to help
You have put the end in the wrong place and the wait you should put it like this
01 | while true do |
02 | if game.Workspace.severethunderstormwatch.Value = = true then |
03 | local pos = script.Parent.alert.Position |
04 | script.Parent.TextLabel.Text = " " |
05 | script.Parent.randomtext.Disabled = true |
06 | script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County" |
07 | script.Parent.alert:TweenPosition(UDim 2. new(- 1.6 , 0 , 0 , 0 ), "In" , "Linear" , 16 ) |
08 | wait( 16 ) |
09 | script.Parent.alert:TweenPosition(pos, "In" , "Linear" , 0 ) |
10 | script.Parent.randomtext.Disabled = false |
11 |
12 | end |
13 | wait( 0.1 ) |
14 | end |