local debounce = false
local part = script.Parent
local function onTouched(part)
if debounce == false then
debounce = true
for i, player in pairs(game.Players:GetPlayers()) do
if player.PlayerGui:FindFirstChild("Camera"):FindFirstChild("Exit").Visible ~= false then print("Camera is up") else
player.Character:BreakJoints()
end
debounce = false
end
end
end
part.Touched:Connect(onTouched)
I am making an instant death part that only kills players who don't have a certain gui visible on their screen. However, when I tested this in studio with two players it killed them both when only one player touched the part. Does anyone know how to fix this?

1 comment
I have been having the same issue, even although the script I’m using is a LocalScript it still runs on every players client