prevent int number as name

master
Alexsandro Percy 2022-01-22 22:43:09 -03:00
parent 6887a2b54d
commit 311d8b5fc5
1 changed files with 24 additions and 18 deletions

View File

@ -461,13 +461,15 @@ minetest.register_entity("zombiestrd:zombie",{
-- self.object:set_hp(99)
self.hp=0
--PONCTUATION
if zombie_score[name] then
zombie_score[name] = zombie_score[name] + 1
check_prizes(puncher, zombie_score[name], "zombie")
else
zombie_score[name] = 1
if tonumber(name) == nil then
if zombie_score[name] then
zombie_score[name] = zombie_score[name] + 1
check_prizes(puncher, zombie_score[name], "zombie")
else
zombie_score[name] = 1
end
savelist()
end
savelist()
--END PONCTUATION
else
mobkit.make_sound(self,'bodyhit')
@ -552,13 +554,15 @@ minetest.register_entity("zombiestrd:ghost",{
-- self.object:set_hp(99)
self.hp=0
--PONCTUATION
if ghost_score[name] then
ghost_score[name] = ghost_score[name] + 1
check_prizes(puncher, ghost_score[name], "ghost")
else
ghost_score[name] = 1
if tonumber(name) == nil then
if ghost_score[name] then
ghost_score[name] = ghost_score[name] + 1
check_prizes(puncher, ghost_score[name], "ghost")
else
ghost_score[name] = 1
end
savelist()
end
savelist()
--END PONCTUATION
else
mobkit.make_sound(self,'bodyhit')
@ -571,13 +575,15 @@ minetest.register_entity("zombiestrd:ghost",{
end
if self.hp<=0 then
--PONCTUATION
if ghost_score[name] then
ghost_score[name] = ghost_score[name] + 1
check_prizes(puncher, ghost_score[name], "ghost")
else
ghost_score[name] = 1
if tonumber(name) == nil then
if ghost_score[name] then
ghost_score[name] = ghost_score[name] + 1
check_prizes(puncher, ghost_score[name], "ghost")
else
ghost_score[name] = 1
end
savelist()
end
savelist()
--END PONCTUATION
end
end