Universal Script 📌
10.1k Views
1.7k Executions

trexinator no collision

Universal Script 📌
rolledrick581
rolledrick581Published 10
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

* works for tsb/lbg * never gets ragdolled while it's toggled on

Updates

  1. Script edited: Update script

  2. Script edited: Update script

View Raw
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
 
local CHECK_INTERVAL = 0.1
local DIST_THRESHOLD = 20
local stopped = false
local connection
 
local function getHRP(character)
    return character and character:FindFirstChild("HumanoidRootPart")
end
 
local function startScript()
    if connection then connection:Disconnect() end
    stopped = false
 
    local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
    localHRP = getHRP(character)
 
    connection = RunService.Heartbeat:Connect(function(dt)
        if stopped or not localHRP then return end
 
        localPos = localHRP.Position
        for _, player in ipairs(Players:GetPlayers()) do
            if player ~= LocalPlayer and player.Character then
                local otherHRP = getHRP(player.Character)
                if otherHRP then
                    local dist = (otherHRP.Position - localPos).Magnitude
                    local shouldCollide = dist >= DIST_THRESHOLD
                    for _, part in ipairs(player.Character:GetDescendants()) do
                        if part:IsA("BasePart") and part.CanCollide ~= shouldCollide then
                            part.CanCollide = shouldCollide
                        end
                    end
                end
            end
        end
    end)
end


Comments

2
Log in to join the conversation. Login
AzScripter's profile picture
AzScripter1 year ago(edited)

If a player dies and comes back to life, does the script still work or does it have to be re-executed?

1
AzScripter's profile picture
AzScripter1 year ago

after I looked at the script it seems to still work if it's alive again

1

More universal scripts

See all
Script hub
291
313
Bumped 53 minutes ago

Script hub

Blythe

Script hub
8.9k
55.1k
Bumped 2 hours ago
Key System
Script hub
505
6.4k
Bumped 5 hours ago
Key System
Universal Script 📌
7.2k
104.7k
Bumped 7 hours ago
Script hub
514
2.1k
Bumped 8 hours ago
Key System
Universal Script 📌
320
2.5k
Approved 11 hours ago