Im trying to make a zombie game. Therefore I basically just have a model of a zombie which is the same of a character just with some parts. When I set the player’s character to the zombie everything is fine.
When I “Zombify” the player and reset instantly the character respawns. However, if I wait a period of time like 10 seconds and then reset, the character does not respawn. And CharacterAutoLoads is indeed enabled.
No, it is like I reset and the player dies and the limbs fall apart etc. However it’s really weird like if i reset seconds after i get “Zombified” i respawn, however if I respawn 20 seconds or so I don’t?
Since you are directly inserting a custom character and thus overwriting the player’s original character, you should call player:LoadCharacter() in case the new humanoid dies.
A simple script inside your zombie model could look like this:
Humanoid.Died:connect(function()
if game.Players:GetPlayerFromCharacter(script.Parent) ~= nil then
local player = game.Players:GetPlayerFromCharacter(script.Parent)
wait(5)
player:LoadCharacter()
end
end)
I have a feeling like this is server-side latency on your behalf. There’s clearly no issue with the script (overwriting the Character should not trigger the respawn delay) and the RespawnDelay property is still locked to 5 iirc. Are you perhaps experiencing any other time discrepancies with your code?
Also another weird thing, when I reset quickly after I get zombified I respawn instantly? Which is quite weird because I never changed the respawn time?