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)
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)