Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --@author FiredDusk (aka Previized)
- --[[ NOTE:
- 1. Make sure you go Configure your game and make it R15 ONLY!
- 2. Put this code in a LocalScript and put the LocalScript: StarterPlayer > StarterCharacterScripts
- 3. Go in Workspace and change the property "FallenPartsDestroyHeight" to -3000 (if needed)
- --]]
- --// Client
- local Player = game.Players.LocalPlayer
- local Character = Player.Character or Player.CharacterAdded:Wait()
- local Mouse = Player:GetMouse()
- local Camera = workspace.CurrentCamera
- --// Services
- local ReplicatedStorage = game:GetService('ReplicatedStorage')
- local UIS = game:GetService('UserInputService')
- local RunService = game:GetService('RunService')
- --// Remotes
- local ShootWeb = game.ReplicatedStorage:WaitForChild('ShootWeb')
- local RemoveWeb = game.ReplicatedStorage:WaitForChild('RemoveWeb')
- local ClimbUpWeb = game.ReplicatedStorage:WaitForChild('ClimbUpWeb')
- local ClimbDownWeb = game.ReplicatedStorage:WaitForChild('ClimbDownWeb')
- local AddForce = game.ReplicatedStorage:WaitForChild('AddForce')
- --// Main
- local BodyForce = Instance.new('BodyForce',Player.Character:WaitForChild('HumanoidRootPart'))
- local Clicked = false
- local CanClick = true
- local AddingForce = false
- Mouse.Button1Down:Connect(function()
- if Clicked == false and Mouse.Target ~= nil and Character:FindFirstChild('LeftHand') and CanClick == true then
- Clicked = true
- CanClick = false
- local Pos = Mouse.Hit.p
- AddingForce = true
- local Request = 'ShootWeb'
- ShootWeb:FireServer(Request,Pos)
- spawn(function()
- while AddingForce == true do
- wait(.01)
- BodyForce.Force = (Camera.CFrame.lookVector * Vector3.new(10000,0,10000))
- if AddingForce == false then
- BodyForce.Force = (Camera.CFrame.lookVector * Vector3.new(1000,0,1000))
- end
- end
- end)
- wait(.5)
- CanClick = true
- elseif Clicked == true and CanClick then
- CanClick = false
- Clicked = false
- AddingForce = false
- local Request = 'RemoveWeb'
- RemoveWeb:FireServer(Request)
- wait(.5)
- CanClick = true
- end
- end)
- --// Climbing Web
- local ClimbingWeb = false
- UIS.InputBegan:Connect(function(Input)
- if Input.KeyCode == Enum.KeyCode.Q then
- local LeftHand = Character:FindFirstChild('LeftHand')
- if LeftHand then
- if LeftHand:FindFirstChild('RopeConstraint') then
- ClimbingWeb = true
- while ClimbingWeb == true and LeftHand:FindFirstChild('RopeConstraint') do
- LeftHand.RopeConstraint.Length = LeftHand.RopeConstraint.Length - 3
- game:GetService('RunService').Heartbeat:Wait()
- end
- end
- end
- end
- end)
- UIS.InputEnded:Connect(function(Input)
- if Input.KeyCode == Enum.KeyCode.Q then
- ClimbingWeb = false
- end
- end)
- --// ReleaseWeb
- UIS.InputBegan:Connect(function(Input)
- if Input.KeyCode == Enum.KeyCode.E then
- ClimbingWeb = true
- local LeftHand = Character:FindFirstChild('LeftHand')
- if LeftHand then
- if LeftHand:FindFirstChild('RopeConstraint') then
- ClimbingWeb = true
- while ClimbingWeb == true and LeftHand:FindFirstChild('RopeConstraint') do
- LeftHand.RopeConstraint.Length = LeftHand.RopeConstraint.Length + 3
- game:GetService('RunService').Heartbeat:Wait()
- end
- end
- end
- end
- end)
- UIS.InputEnded:Connect(function(Input)
- if Input.KeyCode == Enum.KeyCode.E then
- ClimbingWeb = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement