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

Why won't my tweening script work?

Asked by
Nidoxs 190
8 years ago

It's supposed to go from the left to the right at the top left corner of the screen then when the X is clicked it should go back out of the screen. What's wrong?

function open()
wait(1)
script.Parent.Frame:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",1)
script.Parent.Frame.Button.Text = "Welcome to SIDRAT Laboratories, "..script.Parent.Parent.Parent.Name.."!"
end
open()
function close()
script.Parent.Frame:TweenPosition(UDim2.new(0,-500,0,0),"Out","Quad",1)
wait(3)
script.Parent:Destroy()
end

script.Parent.Frame.ButtonX.MouseButton1Down:connect(close)

2
You messed up your fourth Argument in the 'TweenPosition' Methods: You must give it a Number, not a String. :P Also, if possible, please review the Output within the Studio, it may tell you what the exact problem is. :P TheeDeathCaster 2368 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

It should be

script.Parent.Frame:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",1)
0
the last arguement should be a number User#5978 25 — 8y
0
I've already done this. Nidoxs 190 — 8y
0
@DawnHorizon | The last acceptable parameter's the callback function. The last /required/ parameter's the end position. Redbullusa 1580 — 8y
Ad

Answer this question