SkeletalScripts

toggle

Jun 19th, 2020
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. local tog = false
  2. script.Parent.MouseButton1Click:Connect(function()
  3. if tog == false then
  4. tog = true
  5. game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(0.3), {BackgroundColor3 = Color3.fromRGB(158, 255, 47)}):Play()
  6. script.Parent:TweenPosition(UDim2.new(0.501, 0,0, 0),"Out","Linear",0.1,false,nil)
  7. else
  8. tog = false
  9. game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(0.3), {BackgroundColor3 = Color3.fromRGB(255, 0, 0)}):Play()
  10. script.Parent:TweenPosition(UDim2.new(0, 0,0, 0),"Out","Linear",0.1,false,nil)
  11. end
  12. end)
Add Comment
Please, Sign In to add comment