Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local RunService = game:GetService("RunService")
- -- Function to disable collision for all parts of the player's character
- local function disableCollisions()
- if character and character:FindFirstChild("HumanoidRootPart") then
- for _, part in pairs(character:GetChildren()) do
- if part:IsA("BasePart") then
- part.CanCollide = false -- Disable collision
- end
- end
- end
- end
- -- Update the collision settings when the character is added
- player.CharacterAdded:Connect(function(newCharacter)
- character = newCharacter
- disableCollisions()
- end)
- -- Continuously disable collision for the player's character (if it changes or respawns)
- RunService.RenderStepped:Connect(function()
- if character and character:FindFirstChild("HumanoidRootPart") then
- disableCollisions()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement