Hey DarkAssasin0,
There are a few errors I noticed with your code. Well, 2 main errors anyway. Below I will go over the two errors and give you a wiki page and an example of what you can do to fix those errors.
#First Error:
###Your first error that I've noticed is your if statement. First off, the if statement is completely wrong and very much so unnecessary. I can tell what you are trying to do from your if statement, which is to make this Gui tween when the user presses down on a certain Button. However, for this you use Events and Functions, not if statements. The Button has an event of MouseButton1Click and you use that to connect a function, which will run when the Button is Left Clicked. Below is a personal example.
####Example for the Function/Event
local button = script.Parent
function tween_plz()
print("The tweening process is happening atm, muahahah")
end
button.MouseButton1Click:Connect(tween_plz)
#Second Error:
Your second error is your :TweenPosition() statement. Tweening has 6 arguments. 2 of them you can leave out but, the other 4 you have to add. The 4 of them are:
1. Position/Size or Position and Size depending on which one you are doing.
2. EasingDirection. (Controls the direction of the tween)
3. EasingStyle. (The way that it will act when it's tweened)
4. Float time. (The amount of time you want it to cover before it reaches the end.
###Below is a personal example.
####Example for Tweening
local button = script.Parent
function tween_plz()
local gui_to_tween = script.Parent.Parent:WaitForChild("Tweening Gui")
gui_to_tween:TweenPosition(UDim2.new() , Enum.EasingDirection.In , Enum.EasingStyle.Quad , 0.5 )
end
button.MouseButton1Click:Connect(tween_plz)
##Well, that's all the errors I could find, I hope you have a nice day/night.
~~ KingLoneCat
2 comments
http://wiki.roblox.com/index.php?title=The_Fundamentals_of_Scripting_with_GUIs#Input
You're going to want to make changes to the contents of http://wiki.roblox.com/index.php?title=API:Class/PlayerGui , not StarterGui. The contents of StarterGui are cloned there when the player spawns.