I made a rope shooter script but for some reason I cant swing. I shoot the rope and get stuck mid air unable to move. You shoot the rope by holding R and when you release R the rope dissapears. After it dissapears I cant shoot it again.
Any help please?
--// Variables: local plr = game.Players.LocalPlayer local char = plr.Character local head = char:FindFirstChild("Head") local athA = Instance.new("Attachment", head) local athPart = game.Workspace.AttachPart local athB = Instance.new("Attachment", athPart) athA.Position = Vector3.new(0,0,-1) local rope = Instance.new("RopeConstraint", head) local length = (head.Position - athPart.Position).magnitude local uis = game:GetService("UserInputService") isSwinging = false --// Functions: uis.InputBegan:connect(function(key) if key.KeyCode == Enum.KeyCode.R then if isSwinging == false then isSwinging = true rope.Attachment0 = athA rope.Attachment1 = athB rope.Length = length rope.Visible = true end end end) uis.InputEnded:connect(function(key) if key.KeyCode == Enum.KeyCode.R then if isSwinging == true then isSwinging = false rope.Attachment0:Destroy() rope.Attachment1:Destroy() end end end)
https://vimeo.com/user90972315/review/296864730/5403a5d191 Here is how it looks like.
LocalScript inside StarterCharacterScripts