Can SaveData replace pnpc?
Posted: Sun Sep 04, 2022 2:03 am
I want to save a variable to a goomba npc but pnpc is deprecated, I think I can use SaveData to do this instead, but I'm not sure how to do it.
Here is my code:
Yes I am following Enjl's Luna Lua tutorial because I'm new to Luna lua,
Here is my code:
Code: Select all
local goombajumpTimer = 0
function onTick()
goombajumpTimer = goombajumpTimer + 1
if goombajumpTimer > 80 then
goombajumpTimer = 0
end
local goombas = NPC.get(1, player.section)
for index,npc in ipairs(goombas) do
if goombajumpTimer == 0 then
npc.speedY = -10
end
end
end