Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help me on this gui?

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.