zone.playerEntered:Connect(function(player)
game.ReplicatedStorage.OnEnterDevilsPalm:FireAllClients(true)
hasLeft = false
while not debounceForDamage and not hasLeft do
debounceForDamage = true
player.Character.Humanoid.Health -= (1/player.Character.Humanoid.MaxHealth)*100
wait(2)
debounceForDamage = false
end
while not debounceForCorpsePart and not hasLeft do
debounceForCorpsePart = true
print("Hello")
wait(10)
debounceForCorpsePart = false
end
end)
When the player is inside the area the player gets damaged, and the player has a chance to get an item
but I want different wait times when the player gets damage and when he gets a item.
zone.playerEntered:Connect(function(player)
hasLeft = false
game.ReplicatedStorage.OnEnterDevilsPalm:FireAllClients(true)
if not debounceForDamage then
repeat
debounceForDamage = true
player.Character.Humanoid.Health -= (1/player.Character.Humanoid.MaxHealth)*100
task.wait(2)
debounceForDamage = false
until hasLeft
end
if not debounceForCorpsePart then
repeat
debounceForCorpsePart = true
task.wait(10)
debounceForCorpsePart = false
until hasLeft
end
end)
Do you need to use FireAllClients()? Would FireClient() suffice? You already have the player object which is required for FireClient() calls.