Advertisement
otorp2

roblox cannon

Nov 28th, 2017
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1.  
  2. local button = script.Parent
  3. --part named button child clickdetector then this script
  4.  
  5. function fire()
  6. print("hello")
  7. button.BrickColor = BrickColor.new("Really black")
  8. local uberFlake = Instance.new("Part")
  9. uberFlake.Shape = "Ball"
  10. uberFlake.BrickColor = BrickColor.new("White")
  11. uberFlake.Size = Vector3.new(5,5,5)
  12. uberFlake.CanCollide = true
  13. uberFlake.Name = "UberSnowflake"
  14. uberFlake.Parent = workspace
  15. uberFlake.CFrame = CFrame.new(button.Parent.loc.Position+Vector3.new(1, 1, 0))
  16.  
  17. local slower = Instance.new("BodyVelocity")
  18. local x = -20
  19. local y = 5
  20. slower.velocity = Vector3.new(-5,2,0)
  21. slower.maxForce = Vector3.new(1000000,1000000,1000000)
  22. slower.Parent = uberFlake
  23. local erryday = Instance.new("Smoke")
  24. erryday.Parent = uberFlake
  25.  
  26. local count = 0
  27.  
  28.  
  29. for i=1,100 do
  30. count = count + 1
  31.  
  32. y = y - 1
  33. slower.velocity = Vector3.new(x,y,0)
  34. if (count == 15) then
  35. local fire = Instance.new("Fire")
  36. fire.Size = 10
  37. fire.Parent = uberFlake
  38. end
  39. wait(0.1)
  40.  
  41. end
  42.  
  43. end
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. button.ClickDetector.MouseClick:connect(fire)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement