I am making a platformer game and I want to make the level reset every time the player dies but I am not sure how to go about it, any information is welcome!
To answer your question a way you can go about this is make something to watch for the players death and then run code that will reset everything once they die to the point you want to.
Insert a checkpoint in the first level, so everytime they lose they spawn there, DONT add any other checkpoints
not a request site, but you can add a script inside of StarterCharacterScript
and use a loop to check for player's health. And when the health is 0 then you get the player's level and set it to 0.
maybe something like this:
local hum = script.Parent:WaitForChild("Humanoid") while wait() do if hum.Health <= 0 then local player = game.Players:GetPlayerFromCharacter(script.Parent) player:WaitForChild("leaderstats").level.Value = 0 end end
Closed as Not Constructive by Ziffixture
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?