jpkulik
New Member
- Joined
- Mar 15, 2008
- Messages
- 208
- Reaction score
- 2
Hello Guys!
Im doing an Own NPC Arena.. And while im doing the first arena script i got an erro. Can some one help?
Script:
Error:
Cya!
Im doing an Own NPC Arena.. And while im doing the first arena script i got an erro. Can some one help?
Script:
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
------------Arena 1--------------
local arena1cost = 0
local arena1name = 'greenhorn'
local arena1level = 30
local arena1cost = 1000
local arena1storage = 5555
-----------Arena 1 End-----------
if msgcontains(msg, 'greenhorn') and getPlayerStorageValue(cid, 5555) < 1 then
npcHandler:say('Do you really want to do the '..arena1name..' arena for players of level '..arena1level..' or more, paying the price of '..arena1cost..' Gold Coins?', cid)
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if(getPlayerLevel(cid) >= arena1level) then
if(getPlayerMoney(cid) >= arena1cost) then
npcHandler:say('Ok! Good look in the '..arena1name..' arena.', cid)
setPlayerStorageValue(cid, 5555, 1)
else
npcHandler:say('You do not have '..arena1cost..' Gold Coins! Come back when you have it!', cid)
end
else
npcHandler:say('You are not level '..arena1level..'! Come back when you have it!', cid)
end
Error:
Code:
[23/01/2009 18:06:07] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/arena.lua
[23/01/2009 18:06:07] data/npc/scripts/arena.lua:18: 'end' expected (to close 'if' at line 15) near 'local'
Cya!