Advertisement
derekiscool423

cool path

Dec 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Made by OpTic Wisdom/LikeATrollFace
  2.  
  3. kektool = Instance.new("HopperBin" ,game.Players.LocalPlayer.Backpack)
  4. kektool.Name = "MagikTool"
  5. SpeedValue = Instance.new("NumberValue" ,game.Players.LocalPlayer.Backpack.MagikTool)
  6. SpeedValue.Name = "Speed"
  7. SpeedValue.Value =200
  8. Col = Instance.new("BrickColorValue" ,game.Players.LocalPlayer.Backpack.MagikTool)
  9. Col.Name = "Col"
  10. Col.Value = BrickColor.random()
  11.  
  12. bin = game.Players.LocalPlayer.Backpack.MagikTool
  13.  
  14. function onKeyDown(key,mouse)
  15. key:lower()
  16. if key == "r" then
  17. e = game.Workspace:GetChildren()
  18. for i=1,#e do
  19. if e[i].className == "Part" then
  20. if e[i].Name == "Ice" then
  21. if e[i]:findFirstChild("creator")~=nil then
  22. if e[i].creator.Value == game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent then
  23. e[i]:remove()
  24. end
  25. end
  26. end
  27. end
  28. end
  29. elseif key == "n" then
  30. e = game.Workspace:GetChildren()
  31. for i=1,#e do
  32. if e[i].className == "Part" then
  33. if e[i].Name == "Ice" then
  34. e[i]:remove()
  35. end
  36. end
  37. end
  38.  
  39. end
  40. end
  41.  
  42. function press(mouse)
  43. if sel == true then
  44. hit = mouse.Target
  45. local point = mouse.Hit.p
  46. s = Instance.new("Part")
  47. s.CanCollide = true
  48. s.Size=Vector3.new(20, 2, 18)
  49. s.Anchored = true
  50. s.BrickColor = game.Players.LocalPlayer.Backpack.MagikTool.Col.Value
  51. s.Transparency = 0.3
  52. s.Velocity = mouse.Hit.lookVector * game.Players.LocalPlayer.Backpack.MagikTool.Speed.Value
  53. s.Name = "Ice"
  54. s.TopSurface = "Smooth"
  55. s.BottomSurface = "Smooth"
  56. s.Parent = game.Workspace
  57. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Head.Position)
  58. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.x,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.y-4,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.z)
  59. s.CFrame = CFrame.new(s.Position,point)
  60. r = Instance.new("ObjectValue")
  61. r.Value = game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent
  62. r.Parent = s
  63. r.Name = "creator"
  64. wait()
  65. press(mouse)
  66. end
  67. end
  68.  
  69.  
  70. function onButton1Down(mouse)
  71. sel = true
  72. if sel == true then
  73. hit = mouse.Target
  74. local point = mouse.Hit.p
  75. s = Instance.new("Part")
  76. s.CanCollide = true
  77. s.Size=Vector3.new(5,2,17)
  78. s.Anchored = true
  79. s.BrickColor = BrickColor.new("Light blue")
  80. s.Transparency = 0.3
  81. s.Name = "Ice"
  82. s.TopSurface = "Smooth"
  83. s.BottomSurface = "Smooth"
  84. s.Parent = game.Workspace
  85. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Head.Position)
  86. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.x,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.y-5,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.z)
  87. s.CFrame = CFrame.new(s.Position,point)
  88. r = Instance.new("ObjectValue")
  89. r.Value = game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent
  90. r.Parent = s
  91. r.Name = "creator"
  92. wait()
  93. hit = mouse.Target
  94. local point = mouse.Hit.p
  95. s = Instance.new("Part")
  96. s.CanCollide = true
  97. s.Size=Vector3.new(5,2,17)
  98. s.Anchored = true
  99. s.BrickColor = BrickColor.new("Light blue")
  100. s.Transparency = 0.3
  101. s.Name = "Ice"
  102. s.TopSurface = "Smooth"
  103. s.BottomSurface = "Smooth"
  104. s.Parent = game.Workspace
  105. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Head.Position)
  106. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.x,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.y-4,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.z)
  107. s.CFrame = CFrame.new(s.Position,point)
  108. r = Instance.new("ObjectValue")
  109. r.Value = game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent
  110. r.Parent = s
  111. r.Name = "creator"
  112. wait()
  113. hit = mouse.Target
  114. local point = mouse.Hit.p
  115. s = Instance.new("Part")
  116. s.CanCollide = true
  117. s.Size=Vector3.new(5,2,15)
  118. s.Anchored = true
  119. s.BrickColor = BrickColor.new("Light blue")
  120. s.Transparency = 0.3
  121. s.Name = "Ice"
  122. s.TopSurface = "Smooth"
  123. s.BottomSurface = "Smooth"
  124. s.Parent = game.Workspace
  125. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Head.Position)
  126. s.CFrame = CFrame.new(game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.x,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.y-6,game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent.Character.Torso.Position.z)
  127. s.CFrame = CFrame.new(s.Position,point)
  128. r = Instance.new("ObjectValue")
  129. r.Value = game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent
  130. r.Parent = s
  131. r.Name = "creator"
  132. press(mouse)
  133. end
  134. end
  135.  
  136.  
  137. function onButton1Up(mouse)
  138. sel = false
  139. end
  140.  
  141. function onEquippedLocal(mouse)
  142.  
  143. if mouse == nil then
  144. print("Mouse not found")
  145. return
  146. end
  147.  
  148. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  149. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  150. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  151. mouse.KeyDown:connect(onKeyDown)
  152. e = game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent:GetChildren()
  153. for i=1,#e do
  154. if e[i].className == "Hint" then
  155. e[i]:remove()
  156. end
  157. end
  158. s = Instance.new("Hint")
  159. s.Parent = game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent
  160. s.Text = "click R to reset all your ice you made and Hold mouse to create a stream of ice"
  161. end
  162.  
  163. function unsel(mouse)
  164. e = game.Players.LocalPlayer.Backpack.MagikTool.Parent.Parent:GetChildren()
  165. for i=1,#e do
  166. if e[i].className == "Hint" then
  167. e[i]:remove()
  168. end
  169. end
  170. end
  171.  
  172.  
  173. game.Players.LocalPlayer.Backpack.MagikTool.Selected:connect(onEquippedLocal)
  174. game.Players.LocalPlayer.Backpack.MagikTool.Deselected:connect(unsel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement