im making a screen at the end appear when the characters health is equal to zero.
local function player_damage(self)
if self.player_health > 0 then
self.player_health = self.player_health - damage
print(self.player_health)
elseif self.player_health == 0 then
load_endscreen(self)
end
end
and load_endscreen is in my loader script and a global variable
function load_endscreen(self)
msg.post("go#endscreen", "load")
msg.post("go#endscreen", "enable")
end
but i keep getting an error saying
and i have no idea whats causing it