• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua NPC 'Scope' incorrectly working with Functions

I

Icy

Guest
So basically I have an NPC script that emulates a battle between himself and a summoned monster (as part of a tutorial for new players).

What happens is if you tell him you're 'ready' he will summon the monster and set your storage to 0. Every 2s I use the addEvent command to remove the monsters health by 1, send animated red text (1), create a bloodhit effect and create a pool of blood under it.

After 5 hits it dies (10s) and then I try to set the storage of the person to 1. This is where I'm having trouble... It's not recognizing the person, why not?

Relevant NPC Code:
Lua:
addEvent(doneFirstMonster, 10000)

function doneFirstMonster(cid)
	setPlayerStorageValue(cid, monkMonsterSpawned, 1)
end

Error Code in console:
Code:
[11:22:39.942] [Error - NpcScript Interface]
[11:22:39.942] In a timer event called from:
[11:22:39.942] data/npc/scripts/chipotle.lua:onCreatureSay
[11:22:39.942] Description:
[11:22:39.942] (luaDoCreatureSetStorage) Creature not found
 
Thanks Cykotitan.

I've never exactly understood what the `...` meant in the doc.



edit: You must spread some Reputation around before giving it to Cykotitan again.
:p
 
Last edited by a moderator:
Back
Top