Advertisement
okban

Untitled

Jun 25th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.81 KB | None | 0 0
  1. --@author FiredDusk (aka Previized)
  2.  
  3. --[[ NOTE: (READ)
  4. (If you make this into a game with this code, PLEASE give me credit!) I love you <3
  5. Make sure your game has FE TAKEN OFF! This is not FE compatible.
  6.  
  7. 1. Make sure you go Configure your game and make it R15 ONLY!
  8. 2. Put this code in a LocalScript and put the LocalScript in: StarterPlayer > StarterCharacterScripts
  9. 3. Go in Workspace and change the property "FallenPartsDestroyHeight" to -3500 (if you want to)
  10.  
  11. [CONTROLS]:
  12. (Move Camera) - Moves you in that direction
  13. (Left Click) - Throws Web / Removes Web
  14. (Q) - Climb Web
  15. (E) - Climb Down Web
  16.  
  17. My game is here: https://www.roblox.com/games/900966148/Spider-Man-Physics
  18. --]]
  19.  
  20. --// Client
  21. local Player = game.Players.LocalPlayer
  22. local Character = Player.Character or Player.CharacterAdded:Wait()
  23. local Mouse = Player:GetMouse()
  24. local Camera = workspace.CurrentCamera
  25.  
  26. --// Services
  27. local ReplicatedStorage = game:GetService('ReplicatedStorage')
  28. local UIS = game:GetService('UserInputService')
  29. local RunService = game:GetService('RunService')
  30.  
  31. --// Main
  32. local Humanoid = Character:FindFirstChild('Humanoid')
  33. if Humanoid then
  34. Humanoid.JumpPower = 100
  35. Humanoid.WalkSpeed = 20
  36. end
  37.  
  38. local Clicked = false
  39. Mouse.Button1Down:Connect(function()
  40. if Clicked == false and Mouse.Target ~= nil and Character:FindFirstChild('LeftHand') then
  41. Clicked = true
  42. local Pos = Mouse.Hit.p
  43.  
  44. --// I have this commented out if you want an animation. (Might be glitchy!)
  45. -- local Anim = Instance.new('Animation',Character)
  46. -- Anim.AnimationId = 'rbxassetid://769730840'
  47. -- PlayAnim = Character:WaitForChild('Humanoid'):LoadAnimation(Anim)
  48. -- PlayAnim:Play()
  49.  
  50. if Character:FindFirstChild('HumanoidRootPart') then
  51. local Sound = Instance.new('Sound',Character.HumanoidRootPart)
  52. Sound.SoundId = 'rbxassetid://231731980' -- Web sound, you may change this sound id if you want ;)
  53. Sound:Play()
  54. end
  55.  
  56. Part = Instance.new('Part',workspace)
  57. Part.Size = Vector3.new(1,1,1)
  58. Part.Transparency = 1
  59. Part.Anchored = true
  60. Part.CanCollide = false
  61. Part.CFrame = CFrame.new(Pos)
  62.  
  63. local Att0 = Instance.new('Attachment',Player.Character.LeftHand)
  64. local Att1 = Instance.new('Attachment',Part)
  65.  
  66. Rope = Instance.new('RopeConstraint',Player.Character.LeftHand)
  67. Rope.Color = BrickColor.new('Institutional white')
  68. Rope.Visible = true
  69. Rope.Length = (Player.Character.LeftHand.Position - Part.Position).magnitude
  70. Rope.Attachment0 = Att0
  71. Rope.Attachment1 = Att1
  72.  
  73. --// Force
  74. Force = Instance.new('BodyForce',Player.Character:WaitForChild('HumanoidRootPart'))
  75. while Force ~= nil and wait() do
  76. Force.Force = Camera.CFrame.lookVector * Vector3.new(10000,0,10000) -- Force added when you swing. You may change this.
  77. end
  78. elseif Clicked == true then
  79. Clicked = false
  80.  
  81. if Rope then
  82. Rope:Destroy()
  83. end
  84. if Part then
  85. Part:Destroy()
  86. end
  87. if Force then
  88. Force:Destroy()
  89. end
  90. -- if PlayAnim then -- This stop the animation
  91. -- PlayAnim:Stop()
  92. -- end
  93. end
  94. end)
  95. local Clicked2 = false
  96. Mouse.Button2Down:Connect(function()
  97. if Clicked2 == false and Mouse.Target ~= nil and Character:FindFirstChild('RightHand') then
  98. Clicked2 = true
  99. local Pos = Mouse.Hit.p
  100.  
  101. --// I have this commented out if you want an animation. (Might be glitchy!)
  102. -- local Anim = Instance.new('Animation',Character)
  103. -- Anim.AnimationId = 'rbxassetid://769730840'
  104. -- PlayAnim = Character:WaitForChild('Humanoid'):LoadAnimation(Anim)
  105. -- PlayAnim:Play()
  106.  
  107. if Character:FindFirstChild('HumanoidRootPart') then
  108. local Sound2 = Instance.new('Sound',Character.HumanoidRootPart)
  109. Sound2.SoundId = 'rbxassetid://231731980' -- Web sound, you may change this sound id if you want ;)
  110. Sound2:Play()
  111. end
  112.  
  113. Part2 = Instance.new('Part',workspace)
  114. Part2.Size = Vector3.new(1,1,1)
  115. Part2.Transparency = 1
  116. Part2.Anchored = true
  117. Part2.CanCollide = false
  118. Part2.CFrame = CFrame.new(Pos)
  119.  
  120. local Att5 = Instance.new('Attachment',Player.Character.RightHand)
  121. local Att7 = Instance.new('Attachment',Part2)
  122.  
  123. Rope2 = Instance.new('RopeConstraint',Player.Character.RightHand)
  124. Rope2.Color = BrickColor.new('Institutional white')
  125. Rope2.Visible = true
  126. Rope2.Length = (Player.Character.RightHand.Position - Part2.Position).magnitude
  127. Rope2.Attachment0 = Att5
  128. Rope2.Attachment1 = Att7
  129.  
  130. --// Force
  131. Force2 = Instance.new('BodyForce',Player.Character:WaitForChild('HumanoidRootPart'))
  132. while Force2 ~= nil and wait() do
  133. Force2.Force = Camera.CFrame.lookVector * Vector3.new(10000,0,10000) -- Force added when you swing. You may change this.
  134. end
  135. elseif Clicked2 == true then
  136. Clicked2 = false
  137.  
  138. if Rope2 then
  139. Rope2:Destroy()
  140. end
  141. if Part2 then
  142. Part2:Destroy()
  143. end
  144. if Force2 then
  145. Force2:Destroy()
  146. end
  147. -- if PlayAnim then -- This stop the animation
  148. -- PlayAnim:Stop()
  149. -- end
  150. end
  151. end)
  152.  
  153. --// Climbing Web
  154. UIS.InputBegan:Connect(function(Input)
  155. if Input.KeyCode == Enum.KeyCode.Q then
  156. ClimbingWeb = false
  157. if Rope then
  158. ClimbingWeb = true
  159. while ClimbingWeb and Rope do
  160. Rope.Length = Rope.Length - 3 -- Basically, the higher the number, the faster it pulls you.
  161. RunService.RenderStepped:Wait()
  162. end
  163. end
  164. end
  165. end)
  166.  
  167. UIS.InputEnded:Connect(function(Input)
  168. if Input.KeyCode == Enum.KeyCode.Q then
  169. ClimbingWeb = false
  170. end
  171. end)
  172.  
  173. --// ReleaseWeb
  174. UIS.InputBegan:Connect(function(Input)
  175. if Input.KeyCode == Enum.KeyCode.E then
  176. ReleaseWeb = false
  177. if Rope then
  178. ReleaseWeb = true
  179. while ReleaseWeb and Rope do
  180. Rope.Length = Rope.Length + 3 -- Same here, this is for going down though.
  181. RunService.RenderStepped:Wait()
  182. end
  183. end
  184. end
  185. end)
  186.  
  187. UIS.InputEnded:Connect(function(Input)
  188. if Input.KeyCode == Enum.KeyCode.E then
  189. ReleaseWeb = false
  190. end
  191. end)
  192.  
  193. -- HI :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement