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.
local num = 50
local backbutton = script.Parent.Parent.Back
local Image = script.Parent.Parent:WaitForChild("Island")
local Loco = script.Parent.Parent:WaitForChild("Loco")
function onClicked()
script.Parent:TweenPosition(UDim2.new(0.9, 0, -0.9, 0), "Out", "Quad", 1)
script.Parent.Parent.TextButton:TweenPosition(UDim2.new(-0.9, 0, 0.9, 0), "Out", "Quad", 1)
script.Parent.Parent.Change:TweenPosition(UDim2.new(0.5, 0, 0.3, 0), "Out", "Quad", 1)
Image:TweenPosition(UDim2.new(0.9, 0, 0.4, 0), "Out", "Quad", 1)
Loco:TweenPosition(UDim2.new(0.42, 0, -0.9, 0), "Out", "Quad", 1)
for i = 1, num do
backbutton.BackgroundTransparency = 1 - i/num/2
backbutton.TextTransparency = 1 - i/num/2
wait()
end
if backbutton.BackgroundTransparency == 0.5 then
for i = 1, num do
backbutton.BackgroundTransparency = backbutton.BackgroundTransparency - 0.01
backbutton.TextTransparency = backbutton.TextTransparency - 0.01
wait()
end
end
script.Parent.Parent.Back.Active = true
wait(0.6)
end
script.Parent.MouseButton1Down:connect(onClicked)

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