Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local b = 8
- local btn = script.Parent.Middle
- btn.Visible = false
- local btns = {}
- for i = 1, b do
- print(i)
- local nb = btn:Clone()
- btns[#btns+1]=nb
- nb.ImageButton.BackgroundTransparency = 1
- nb.Visible = true
- nb.Rotation = (i-1)*(360/b)
- nb.Parent = script.Parent
- nb.ImageButton.MouseButton1Click:connect(function()
- for x,bt in ipairs(btns) do
- if x ~= i then
- bt.ImageButton:TweenPosition(UDim2.new(0,-50,0,-520),nil,nil,1)
- spawn(function()
- local n = 0
- local r = bt.Rotation
- while n<1 do
- n=n+wait()
- bt.ImageButton.ImageTransparency = n
- bt.Rotation = r + (n*180)
- end
- bt:Destroy()
- end)
- else
- bt.ImageButton:TweenPosition(UDim2.new(0,-50,0,-180),nil,nil,1)
- spawn(function()
- local n = 0
- local r = bt.Rotation
- while n<1 do
- n=n+wait()
- --(math.sin(n*math.pi*15)/4)+.5
- bt.ImageButton.ImageTransparency = n
- --bt.Rotation = r + (n*180)
- end
- bt:Destroy()
- end)
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment