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

Help me on this gui?

Asked by 9 years ago

I tried to make my gui Play button spin and go up when you clicked it but, it won't work can you guys help?

local player = script.Parent.Parent.Parent.Parent.Parent
local gui = player.PlayerGui
function Touch()
    script.Parent.Play.Rotation = 5
    script.Parent.Play.Position = {0,0},{0,-5}
    wait()
    script.Parent.Play.Rotation = 10
    script.Parent.Play.Position = {0,0},{0,-10}
    wait()
    script.Parent.Play.Rotation = 15
    script.Parent.Play.Position = {0,0},{0,-15}
    wait()
    script.Parent.Play.Rotation = 20
    script.Parent.Play.Position = {0,0},{0,-20}
    wait()
    script.Parent.Play.Rotation = 25
    script.Parent.Play.Position = {0,0},{0,-25}
    wait()
    script.Parent.Play.Rotation = 30
    script.Parent.Play.Position = {0,0},{0,-30}
end

script.Parent.MouseButton1Down:connect(Touch) 

1 answer

Log in to vote
0
Answered by 9 years ago

Intead of defining the position like this:

script.Parent.Play.Position = {0,0},{0,-30}

Use UDim2.new

script.Parent.Play.Position = UDim2.new(0,0,0,-30)

UDim2.new is to changing the position or size of GUI's as Vector3.new is to changing the position or size of bricks

Ad

Answer this question