Workspace turning upside down

i made a tower and a script after this workspace turning upside down
the script made this:

script.Parent.Touched:Connect(function(hit)
local plr = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
plr.Character:PivotTo(workspace.HoleTp:GetPivot())
end)
and i try to fix with
script.Parent.Touched:Connect(function(hit)
local plr = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
if not game.Players:FindFirstChild(plr.Name) then return end
plr.Character:PivotTo(workspace.HoleTp:GetPivot())
end)

the problem is the script?

video:
robloxapp-20240527-2140072.wmv (1.6 MB)

Final Script with Debounce

local debounce = false

script.Parent.Touched:Connect(function(hit)
    if debounce then return end
    debounce = true

    local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
    if plr then
        local character = plr.Character
        if character and character:FindFirstChild("HumanoidRootPart") then
            character:PivotTo(workspace.HoleTp:GetPivot())
        end
    end

    wait(1)  -- Adjust the debounce time as necessary
    debounce = false
end)

It worked better, but now the tower is self-destructing

BRUH I JUST FORGOT TO ANCHOR MAP

but thanks for script

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.