Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(5)
- local active = true
- local fixpart = Instance.new("Part")
- fixpart.Parent = game.Workspace
- fixpart.Transparency = 1
- local parts = {}
- function FUNCTION(a)
- if (a.className == "Part") or (a.className == "Seat") or (a.className == "SpawnLocation") or (a.className == "Union") or (a.className == "MeshPart") then
- if a.Anchored == false and (a:IsDescendantOf(game.Players.LocalPlayer.Character) == false) then
- table.insert(parts, a)
- end
- end
- local b = a:GetChildren()
- for i=1,#b do
- FUNCTION(b[i])
- end
- end
- FUNCTION(game.workspace)
- for i,v in pairs(parts) do
- wait(.01)
- v.CanCollide = true
- local bp = Instance.new("BodyPosition")
- bp.P = 0
- bp.Parent = v
- local att1 = Instance.new("Attachment")
- att1.Parent = v
- local att2 = Instance.new("Attachment")
- att2.Parent = fixpart
- local weldfix = Instance.new("RopeConstraint")
- weldfix.Length = 0
- weldfix.Parent = v
- weldfix.Attachment0 = att1
- weldfix.Attachment1 = att2
- end
- game:GetService("RunService").RenderStepped:Connect(function()
- fixpart.Position = game.Players.LocalPlayer:GetMouse().Hit.Position
- end)
- function onKeyPress(actionName, userInputState, inputObject)
- if userInputState == Enum.UserInputState.Begin then
- if active == true then
- active = false
- for i,v in pairs(parts) do
- v.RopeConstraint.Enabled = false
- end
- else
- active = true
- for i,v in pairs(parts) do
- v.RopeConstraint.Enabled = true
- end
- end
- end
- end
- game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.X)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement