Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Will this data saving thing work?

Asked by 9 years ago

So i'm trying to make a digimon game. And the levels reset whenever the player resets, or gets killed. The player's level is inside a gui. here the code:

while true do
    Lvlval = script.Parent.Lvl.Value
    wait(2)
    hum = script.Parent.Parent.Parent.Parent:GetCharacterFromPlayer()
    if hum.Humanoid.Health >= 1 then
        wait(5)
        script.Parent.Lvl = Lvlval
    end
end

So I give 5 seconds for the player to respawn, then the script has to change their level back to what it was before they died, or reset. I need a answer quick!

Answer this question