Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- parent = script.Parent
- amt = 3
- coloramt = 20 -- with 20 it turns the background color whiter by 12% (as seen in video). You can change to 0 if you don't want white.
- pcolorr = parent.BackgroundColor3.r
- pcolorg = parent.BackgroundColor3.g
- pcolorb = parent.BackgroundColor3.b
- pposx = parent.Position.X.Offset
- pposy = parent.Position.Y.Offset
- psizex = parent.Size.X.Offset
- psizey = parent.Size.Y.Offset
- parent.AutoButtonColor = false
- parent.MouseButton1Click:connect(function()
- parent.BackgroundColor3 = Color3.new(pcolorr + coloramt/255, pcolorg + coloramt/255, pcolorb + coloramt/255)
- parent:TweenSizeAndPosition(
- UDim2.new(0, psizex - amt * 2, 0, psizey - amt * 2),
- UDim2.new(0, pposx + amt, 0, pposy + amt),
- "Out",
- "Quad",
- 0.06
- )
- wait(0.1)
- parent.BackgroundColor3 = Color3.new(pcolorr, pcolorg, pcolorb)
- parent:TweenSizeAndPosition(
- UDim2.new(0, psizex, 0, psizey),
- UDim2.new(0, pposx, 0, pposy),
- "Out",
- "Quad",
- 0.06
- )
- end)
- wait()
- parent.MouseButton1Down:connect(function()
- parent.BackgroundColor3 = Color3.new(pcolorr + coloramt/255, pcolorg + coloramt/255, pcolorb + coloramt/255)
- parent:TweenSizeAndPosition(
- UDim2.new(0, psizex - amt * 2, 0, psizey - amt * 2),
- UDim2.new(0, pposx + amt, 0, pposy + amt),
- "Out",
- "Quad",
- 0.06
- )
- end)
- parent.MouseButton1Up:connect(function()
- parent.BackgroundColor3 = Color3.new(pcolorr, pcolorg, pcolorb)
- parent:TweenSizeAndPosition(
- UDim2.new(0, psizex, 0, psizey),
- UDim2.new(0, pposx, 0, pposy),
- "Out",
- "Quad",
- 0.06
- )
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement