Advertisement
Mautiku

Nc

May 12th, 2025
1,292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. --[[ NO COLLISION BY SUSSY
  2. /e nc to stop
  3. nc mean no collision!
  4. ]]
  5. local Players = game:GetService("Players")
  6. local RunService = game:GetService("RunService")
  7. local LocalPlayer = Players.LocalPlayer
  8.  
  9. local CHECK_INTERVAL = 0.1
  10. local DIST_THRESHOLD = 20
  11. local stopped = false
  12. local connection
  13.  
  14. local function getHRP(character)
  15.     return character and character:FindFirstChild("HumanoidRootPart")
  16. end
  17.  
  18. local function startScript()
  19.     if connection then connection:Disconnect() end
  20.     stopped = false
  21.  
  22.     local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  23.     localHRP = getHRP(character)
  24.  
  25.     connection = RunService.Heartbeat:Connect(function(dt)
  26.         if stopped or not localHRP then return end
  27.  
  28.         localPos = localHRP.Position
  29.         for _, player in ipairs(Players:GetPlayers()) do
  30.             if player ~= LocalPlayer and player.Character then
  31.                 local otherHRP = getHRP(player.Character)
  32.                 if otherHRP then
  33.                     local dist = (otherHRP.Position - localPos).Magnitude
  34.                     local shouldCollide = dist >= DIST_THRESHOLD
  35.                     for _, part in ipairs(player.Character:GetDescendants()) do
  36.                         if part:IsA("BasePart") and part.CanCollide ~= shouldCollide then
  37.                             part.CanCollide = shouldCollide
  38.                         end
  39.                     end
  40.                 end
  41.             end
  42.         end
  43.     end)
  44. end
  45.  
  46. LocalPlayer.Chatted:Connect(function(msg)
  47.     if msg:lower() == "/e nc" then
  48.         stopped = true
  49.     end
  50. end)
  51.  
  52. startScript()
  53.  
  54.  
  55. LocalPlayer.CharacterAdded:Connect(function()
  56.     task.wait(1)
  57.     startScript()
  58. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement