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

Can you help me with this Open Gui Animation?!

Asked by 8 years ago

Hey guys, again with another question about my Gui, sorry I am very new to this whole coding thing. I got everything working with the helps of some others, thanks go out to them! But now I am facing the problem of getting an animation to work with it, like I am trying to get it to come up from the bottom to the middle of the screen in a smooth transition but I can't find out any way how, and cant get a Open/Close Gui that does that, so I can go off of it. Please help if you can, any at all is appreciated...

Open script:

function die()
script.Parent.Parent.ShopGui.Visible = true
script.Parent.Parent.Parent.Sound:Play()
wait()
end
script.Parent.MouseButton1Down:connect(die)

2 answers

Log in to vote
0
Answered by 8 years ago
function die()
script.Parent.Parent.ShopGui.Visible = true
script.Parent.Parent.Parent.Sound:Play()
wait()
end
script.Parent.MouseButton1Down:connect(die())

on line 6 you forgot to define the function as a function

Ad
Log in to vote
0
Answered by 8 years ago

Here is a link to the wiki article and in case that isnt enough i will explain it

so for tweening functions it takes several parameters. start with you have the position given in the UDim2 format which is (Xscale, Xoffset, Yscale, Yoffset). next we have our easing direction and style but im not gonna get too far into that. Then we have the amount of time that it takes for the animation to occur and finally we have the override which can be true or false. if it is true then the animation can be interrupted otherwise it cannot so to put in perspective what this will look like for you would be something like this

script.Parent.Parent.ShopGui:TweenPosition(UDim2.new(.5, -( half the width ), .5, -( half the height)), "Out", "Linear", 1, true)

now what that does is it will take the ShopGui object and move it from its current position to the exact center of the screen in the time span of 1 second and it can be interrupted. Hope that this helped

Answer this question