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

Had many UDim2 animations script fixed. But this one does still only work in Studio?

Asked by 8 years ago
Edited 8 years ago

I have a lot of scripts with UDim2 animations for my Gui.

First fix is that it got changed to Local Script Second fix is that I used WaitForChild()

But this single script does still not work. (Not at all) It works completely fine in studio. It gives me no errors.

01local num = 50
02local backbutton = script.Parent.Parent.Back
03local Image = script.Parent.Parent:WaitForChild("Island")
04local Loco = script.Parent.Parent:WaitForChild("Loco")
05 
06function onClicked()
07    script.Parent:TweenPosition(UDim2.new(0.9, 0, -0.9, 0), "Out", "Quad", 1)
08    script.Parent.Parent.TextButton:TweenPosition(UDim2.new(-0.9, 0, 0.9, 0), "Out", "Quad", 1)
09    script.Parent.Parent.Change:TweenPosition(UDim2.new(0.5, 0, 0.3, 0), "Out", "Quad", 1)
10    Image:TweenPosition(UDim2.new(0.9, 0, 0.4, 0), "Out", "Quad", 1)
11    Loco:TweenPosition(UDim2.new(0.42, 0, -0.9, 0), "Out", "Quad", 1)
12    for i = 1, num do
13        backbutton.BackgroundTransparency = 1 - i/num/2
14        backbutton.TextTransparency = 1 - i/num/2
15        wait()
View all 29 lines...

1 answer

Log in to vote
1
Answered by 8 years ago

Put your MouseButton events in a localscript. Leave the other code in a server script, but call it from the localscript via a remote server event. That should fix the issues.

You said it works in studio - clicking Play button or doing a 1 player server? See if 1 player server works - I'm guessing it doesnt.

0
It works anywhere, Anytime with anything in Studio. Well guess again... MineJulRBX 52 — 8y
0
Omg! I just moved the animation in a local script and the transparency change in a server script. Now it works! MineJulRBX 52 — 8y
0
Yeah it probably worked before, but Roblox changed things... A friend and I were noticing this with a plugin he developed. JasonTheOwner 391 — 8y
Ad

Answer this question