Score Reset on Death?

Status
Not open for further replies.

Theqmayn

Member
Is there a setting or a way to make it so your score resets upon your death?
Also on level clear and entering another level?
 
well...
Should be something like
"if player.mo.state == S_PLAY_DIE
player.score = 0"

as for reseting on level, just do the same thing with a MapLoad hook and you should be okay with this.
 
Don't tell me you copypasted my lines between the quotes and thought this would've worked... Here are full codes ready to copypaste...

Reset on death:
Code:
addHook("ThinkFrame", do
 for player in players.iterate
 if not player.mo return end

  if player.mo.state == S_PLAY_DIE
   player.score = 0
 end
end
end)
Reset on Map Load:
Code:
addHook("MapLoad", do
 for player in players.iterate
 if not player.mo return end

 player.score = 0
end
end)
I didn't test any of them but they should work.
 
Don't tell me you copypasted my lines between the quotes and thought this would've worked... Here are full codes ready to copypaste...

Reset on death:
Code:
addHook("ThinkFrame", do
 for player in players.iterate
 if not player.mo return end

  if player.mo.state == S_PLAY_DIE
   player.score = 0
 end
end
end)
Reset on Map Load:
Code:
addHook("MapLoad", do
 for player in players.iterate
 if not player.mo return end

 player.score = 0
end
end)
I didn't test any of them but they should work.


Thank you Lat it works perfectly!
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top