Advertisement
HowToRoblox

WebSwingingClient

Jan 25th, 2022
1,246
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local mouse = game.Players.LocalPlayer:GetMouse()
  2.  
  3. local currentRope = nil
  4.  
  5.  
  6. mouse.Button1Down:Connect(function()
  7.  
  8.     if not currentRope then
  9.  
  10.         if mouse.Target and mouse.Target.Anchored == true then
  11.  
  12.             game.ReplicatedStorage:WaitForChild("WebSwingingRE"):FireServer("createRope", mouse.Hit.Position, mouse.Target)
  13.         end
  14.     end
  15. end)
  16.  
  17. mouse.Button1Up:Connect(function()
  18.  
  19.     if currentRope then
  20.         game.ReplicatedStorage:WaitForChild("WebSwingingRE"):FireServer("destroyRope")
  21.     end
  22. end)
  23.  
  24.  
  25. game.ReplicatedStorage:WaitForChild("WebSwingingRE").OnClientEvent:Connect(function(rope)
  26.  
  27.     currentRope = rope
  28. end)
  29.  
  30.  
  31. game:GetService("RunService").Heartbeat:Connect(function()
  32.  
  33.     if currentRope then
  34.         script.Parent.HumanoidRootPart.Velocity = script.Parent.HumanoidRootPart.CFrame.LookVector * 100
  35.     end
  36. end)
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement