aidanthescriptor101

surf

Oct 2nd, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. Player = game:GetService("Players").LocalPlayer
  2. Character = Player.Character
  3. PlayerGui = Player.PlayerGui
  4. Backpack = Player.Backpack
  5. Torso = Character.Torso
  6. Head = Character.Head
  7. LeftArm = Character["Left Arm"]
  8. LeftLeg = Character["Left Leg"]
  9. RightArm = Character["Right Arm"]
  10. RightLeg = Character["Right Leg"]
  11. LS = Torso["Left Shoulder"]
  12. LH = Torso["Left Hip"]
  13. RS = Torso["Right Shoulder"]
  14. RH = Torso["Right Hip"]
  15. X = 5 -- Size.X of the Path
  16. Y = 2 -- Size.Y of the Path
  17. Z = 6 -- Size.Z of the Path
  18. Longness = 9999999999 -- How long the Path will stay
  19. velo = 100
  20. rot = 0
  21. q = Vector3.new(0,0,0)
  22.  
  23. function laser(to,from) -- MUST BE VECTOR3
  24. local las=Instance.new("Part",Workspace)
  25. las.Anchored=true
  26. las.Locked=true
  27. las.CanCollide=false
  28. las.TopSurface=0
  29. las.BottomSurface=0
  30. las.FormFactor = "Custom"
  31. las.BrickColor=BrickColor.new("Bright orange")
  32. las.Size=Vector3.new(1,1,1)
  33. las.CFrame=CFrame.new((to+from)/2,from)*CFrame.Angles(math.rad(90),0,0)
  34. game.Debris:AddItem(las,5)
  35. local msh=Instance.new("SpecialMesh",las)
  36. msh.Scale=Vector3.new(1,(to-from).magnitude,1)
  37. return las
  38. end
  39.  
  40.  
  41. color = {BrickColor.new("Bright orange")}
  42. selected = math.random(1,#color)
  43. if (script.Parent.className ~= "HopperBin") then
  44. Tool = Instance.new("HopperBin")
  45. Tool.Parent = Backpack
  46. Tool.Name = "Air Path"
  47. script.Parent = Tool
  48. end
  49. Bin = script.Parent
  50.  
  51. hold = false
  52. LH0 = LH.C0
  53. RH0 = RH.C0
  54. LS0 = LS.C0
  55. RS0 = RS.C0
  56.  
  57. function ob1d(mouse)
  58. hold = true
  59. Character.Humanoid.PlatformStand = true
  60. wp = Instance.new("Part")
  61. wp.Parent = Character
  62. wp.Size = Vector3.new(1,0.4,1)
  63. wp.formFactor = "Plate"
  64. wp.Transparency = 1
  65. bg = Instance.new("BodyGyro")
  66. bg.Parent = wp
  67. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  68. bv = Instance.new("BodyVelocity")
  69. bv.Parent = wp
  70. bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  71. w = Instance.new("Weld")
  72. w.Parent = Torso
  73. w.Part0 = Torso
  74. w.Part1 = wp
  75. RH.C0 = CFrame.new(.25,-1.25,0) * CFrame.Angles(0,math.pi+math.pi/2,0) * CFrame.Angles(math.pi/8,0,0)
  76. LH.C0 = CFrame.new(-.75,-1,0) * CFrame.Angles(0,math.pi+math.pi/2,0) * CFrame.Angles(-math.pi/8,0,0)
  77. RS.C0 = CFrame.new(2,.75,0) * CFrame.Angles(0,math.pi+math.pi/2,0) * CFrame.Angles(math.pi/4,0,0)
  78. LS.C0 = CFrame.new(-1.25,0,0) * CFrame.Angles(0,math.pi+math.pi/2,0) * CFrame.Angles(-math.pi/4,0,0)
  79. while hold == true do
  80. bv.velocity = (mouse.Hit.lookVector*velo)
  81. if rot == -1 then
  82. bg.cframe = CFrame.new(Torso.Position,mouse.Hit.p) * CFrame.Angles(0,0--[[math.pi/2]],math.pi/4)
  83. elseif rot == 1 then
  84. bg.cframe = CFrame.new(Torso.Position,mouse.Hit.p) * CFrame.Angles(0,0--[[math.pi/2]],-math.pi/4)
  85. elseif rot == 0 then
  86. bg.cframe = CFrame.new(Torso.Position,mouse.Hit.p) * CFrame.Angles(0,math.pi/2,0)
  87. elseif rot == 2 then
  88. bg.cframe = CFrame.new(Torso.Position,mouse.Hit.p) * CFrame.Angles(0,0,math.pi)
  89. elseif rot == -2 then
  90. bg.cframe = CFrame.new(Torso.Position,mouse.Hit.p) * CFrame.Angles(0,math.pi,0)
  91. end
  92. Character.Humanoid.PlatformStand = true
  93. local part = Instance.new("Part")
  94. part.Parent = Character
  95. part.Size = Vector3.new(X,Y,Z)
  96. part.formFactor = "Symmetric"
  97. part.Anchored = true
  98. part.Transparency = 1
  99. part.Velocity = mouse.Hit.lookVector*velo
  100. part.CFrame = Torso.CFrame * CFrame.new(0,-3.5,0)
  101. part.CFrame = CFrame.new(part.Position,mouse.Hit.p)
  102. part.CFrame = part.CFrame + part.CFrame.lookVector * 2.5
  103. laser(q,part.Position)
  104. q = part.Position
  105. part.TopSurface = 0
  106. part.BottomSurface = 0
  107. if rot == -1 then
  108. part.CFrame = part.CFrame * CFrame.Angles(0,0,math.pi/4)
  109. elseif rot == 1 then
  110. part.CFrame = part.CFrame * CFrame.Angles(0,0,-math.pi/4)
  111. elseif rot == 2 then
  112. part.CFrame = part.CFrame * CFrame.Angles(0,0,math.pi)
  113. --[[elseif rot == -2 then
  114. part.CFrame = part.CFrame * CFrame.Angles(0,math.pi,0) ]]
  115. end
  116. part.Transparency = 1
  117. part.BrickColor = color[selected]
  118. coroutine.resume(coroutine.create(function()
  119. wait(Longness)
  120. part:remove()
  121. end))
  122. wait()
  123. end
  124. end
  125.  
  126. function ob1u(mouse)
  127. hold = false
  128. LH.C0 = LH0
  129. RH.C0 = RH0
  130. LS.C0 = LS0
  131. RS.C0 = RS0
  132. Character.Humanoid.PlatformStand = false
  133. wp:remove()
  134. end
  135.  
  136. buttonhold = false
  137.  
  138. function key(key)
  139. if key == "q" then
  140. wait()
  141. buttonhold = true
  142. rot = -1
  143. velo = velo/1.5
  144. end
  145. if key == "e" then
  146. wait()
  147. rot = 1
  148. velo = velo/1.5
  149. buttonhold = true
  150. end
  151. if key == "r" then
  152. wait()
  153. rot = 2
  154. velo = velo/1.5
  155. end
  156. if key == "f" then
  157. wait()
  158. rot = -2
  159. velo = velo/1.5
  160. end
  161.  
  162. end
  163.  
  164. function key2(key)
  165. if key == "e" or key == "q" or key == "r" or key == "f" then
  166. buttonhold = false
  167. rot = 0
  168. velo = velo*1.5
  169. end
  170. if key == "z" then
  171. velo = 150
  172. elseif key == "x" then
  173. velo = 300
  174. end
  175. end
  176.  
  177. function s(mouse)
  178. mouse.Button1Down:connect(function() ob1d(mouse) end)
  179. mouse.Button1Up:connect(function() ob1u(mouse) end)
  180. mouse.KeyDown:connect(key)
  181. mouse.KeyUp:connect(key2)
  182. end
  183. function ds(mouse)
  184. end
  185. Bin.Selected:connect(s)
  186. Bin.Deselected:connect(ds)
Add Comment
Please, Sign In to add comment