Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mouse = game.Players.LocalPlayer:GetMouse()
- local currentRope = nil
- mouse.Button1Down:Connect(function()
- if not currentRope then
- if mouse.Target and mouse.Target.Anchored == true then
- game.ReplicatedStorage:WaitForChild("WebSwingingRE"):FireServer("createRope", mouse.Hit.Position, mouse.Target)
- end
- end
- end)
- mouse.Button1Up:Connect(function()
- if currentRope then
- game.ReplicatedStorage:WaitForChild("WebSwingingRE"):FireServer("destroyRope")
- end
- end)
- game.ReplicatedStorage:WaitForChild("WebSwingingRE").OnClientEvent:Connect(function(rope)
- currentRope = rope
- end)
- game:GetService("RunService").Heartbeat:Connect(function()
- if currentRope then
- script.Parent.HumanoidRootPart.Velocity = script.Parent.HumanoidRootPart.CFrame.LookVector * 100
- end
- end)
Advertisement
Advertisement
Advertisement
RAW Paste Data
Copied
Advertisement