fartfart1555

TORNADO

Jul 22nd, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. maxtorn = 5 -- Max ammount of tornados
  2. torn = 1
  3.  
  4.  
  5.  
  6. if script.Parent.className ~= "HopperBin" then
  7.  
  8. local H = Instance.new("HopperBin")
  9.  
  10. H.Parent = game:service("Players").Player1.Backpack
  11.  
  12. H.Name = "Tornado"
  13.  
  14. script.Parent = H
  15.  
  16. end
  17. debounce = false
  18.  
  19.  
  20.  
  21.  
  22. plr=game.Players.Player1
  23.  
  24. sp=script.Parent
  25. Mouse = plr:GetMouse()
  26. tab = {}
  27. debris = game:GetService("Debris")
  28. function createtorn()
  29. local hitta = Mouse.Hit
  30.  
  31. for size = 1, 10, 0.2 do
  32.  
  33. local z = Instance.new("Part")
  34. local new=z:Clone()
  35. new.Parent = game.Workspace
  36.  
  37. new.Anchored = true
  38.  
  39. new.Size = Vector3.new(size,0,size)
  40.  
  41. new.CFrame = CFrame.new(hitta.p.X, hitta.p.Y + size, hitta.p.Z) * CFrame.Angles(0,size,0)
  42.  
  43. table.insert(tab, new)
  44.  
  45. wait()
  46. end
  47. end
  48. function cleanup()
  49. for i,v in pairs(tab) do
  50. debris:AddItem(v,1)
  51. end
  52. end
  53. function Clicked(Mouse)
  54. if debounce == true then return end
  55. debounce = true
  56. createtorn()
  57. if torn >= maxtorn then
  58. cleanup()
  59. torn = 1
  60. elseif torn < maxtorn then
  61. torn = torn +1
  62. print(torn)
  63. end
  64. wait()
  65. debounce = false
  66. end
  67.  
  68.  
  69. function onKeyDown(key)
  70.  
  71. end
  72.  
  73.  
  74.  
  75. function Selected(Mouse)
  76.  
  77. Mouse.KeyDown:connect(onKeyDown)
  78.  
  79. Mouse.Button1Down:connect(function()Clicked(Mouse)end)
  80.  
  81. end
  82.  
  83.  
  84.  
  85. function Deselected(Mouse)
  86.  
  87. end
  88.  
  89.  
  90.  
  91. sp.Selected:connect(Selected)
  92.  
  93. sp.Deselected:connect(Deselected)
Add Comment
Please, Sign In to add comment