NPCs[18].func = function(npc, id, words, state)
if words == "hi" then
NPCspeak(npc, "Greetings! Say 'reset' if you need to reset your level.")
PLAYERS[id].tmp.npcstate = {npc, 1}
elseif contains(words, "bye") then
NPCspeak(npc, "Goodbye.")
PLAYERS[id].tmp.npcstate = nil
elseif state == 1 then
if contains(words, "reset") then
NPCspeak(npc, "Would you like to reset your level for $10?")
PLAYERS[id].tmp.npcstate = {npc, 2}
end
elseif state == 2 then
if contains(words, "yes") then
if addmoney(id, -10) then
message(id, "You have lost $10.", "255255255")
PLAYERS[id].Level = 1
PLAYERS[id].Experience = 1
updateHUD(id)
NPCspeak(npc, "Enjoy!")
PLAYERS[id].tmp.npcstate = nil
else
NPCspeak(npc, "Don't try to reset without paying!")
PLAYERS[id].tmp.npcstate = nil
end
elseif contains(words, "no") then
NPCspeak(npc, "Alright then.")
PLAYERS[id].tmp.npcstate = nil
end
end
end