• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

help 1 little problem plxxx

Animera

* * * * *
Joined
Dec 9, 2008
Messages
2,449
Solutions
5
Reaction score
618
Location
ANIMERARPG.ONLINE
whats wrong with this?

PHP:
[18/02/2010 23:01:28] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/frieza.lua
[18/02/2010 23:01:28] data/npc/scripts/frieza.lua:19: unexpected symbol near 'if'
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

npcHandler:addModule(FocusModule:new())

if(msgcontains(msg, 'problems') or msgcontains(msg, 'mission')) then
		selfSay('Goku defeated me please take revenge for me.', cid)
		        talkState[talkUser] = 1
elseif(msgcontains(msg, 'goku') and talkState[talkUser] == 1) then
		selfSay('Goku is east of here please defeat him! Just open the door.', cid)
		setPlayerStorageValue(cid, 30000, 1)
		        talkState[talkUser] = 2
elseif(msgcontains(msg, 'revenged') and if setPlayerStorageValue(cid, 40000, 16)  and talkState[talkUser] == 2)then
		selfSay('Thanks a lot now i can continue take over universe, here the supernova technique have fun.', cid)
		doPlayerLearnInstantSpell(cid, supernova)
		        talkState[talkUser] = 3
	else
		selfSay('What are you lying to me, you monkey!.', cid)
		        talkState[talkUser] = 4
end
 
Last edited:
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

npcHandler:addModule(FocusModule:new())

    if(msgcontains(msg, 'problems') or msgcontains(msg, 'mission')) then
        selfSay('Goku defeated me please take revenge for me.', cid)
                talkState[talkUser] = 1
    elseif(msgcontains(msg, 'goku') and talkState[talkUser] == 1) then
        selfSay('Goku is east of here please defeat him! Just open the door.', cid)
        setPlayerStorageValue(cid, 30000, 1)
                talkState[talkUser] = 2
    elseif(msgcontains(msg, 'revenged') and setPlayerStorageValue(cid, 40000, 16) and talkState[talkUser] == 2)then
        selfSay('Thanks a lot now i can continue take over universe, here the supernova technique have fun.', cid)
        doPlayerLearnInstantSpell(cid, supernova)
                talkState[talkUser] = 3
    else
        selfSay('What are you lying to me, you monkey!.', cid)
                talkState[talkUser] = 4
return true
end
 
Last edited:
sorry but
PHP:
[19/02/2010 00:03:55] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/frieza.lua
[19/02/2010 00:03:56] data/npc/scripts/frieza.lua:19: unexpected symbol near 'if'
 
PHP:
[19/02/2010 00:11:46] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/frieza.lua
[19/02/2010 00:11:46] data/npc/scripts/frieza.lua:28: '<eof>' expected near 'end'
i tried already put end to it even several times more behind but still same error!
 
PHP:
[19/02/2010 00:31:38] Lua Script Error: [Npc interface] 
[19/02/2010 00:31:38] data/npc/scripts/frieza.lua

[19/02/2010 00:31:38] data/npc/lib/npc.lua:54: attempt to index local 'message' (a nil value)
[19/02/2010 00:31:38] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/frieza.lua

actually i don't do rep++ it's gay but if you help me with this then i sure will give you :)
 
someone sucks at Lua ..
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}

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

function greetCallback(cid) Topic[cid] = 0 return true end
function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif msgcontains(msg, "problem") or msgcontains(msg, "mission") or msgcontains(msg, "quest") then
		selfSay("{Goku} defeated me, please take revenge for me.", cid)
		Topic[cid] = 1
	elseif msgcontains(msg, "goku") and Topic[cid] == 1 then
		selfSay("Goku is east of here, please defeat him! Just open the door. Ask me about {revenge} once you defeat him.", cid)
		setPlayerStorageValue(cid, 30000, 1)
		Topic[cid] = 0
	elseif msgcontains(msg, "revenge") then
		if getPlayerStorageValue(cid, 40000) == 16 then
			selfSay("Thanks a lot, now I can continue with taking over the universe. Here is the supernova technique, have fun!", cid)
			doPlayerLearnInstantSpell(cid, "Supernova")
			-- You need to set another storage here to prevent this from repeating!
		else
			selfSay("What are you lying to me, you monkey!?", cid)
		end
		Topic[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
someone sucks at Lua ..
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}

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

function greetCallback(cid) Topic[cid] = 0 return true end
function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif msgcontains(msg, "problem") or msgcontains(msg, "mission") or msgcontains(msg, "quest") then
		selfSay("{Goku} defeated me, please take revenge for me.", cid)
		Topic[cid] = 1
	elseif msgcontains(msg, "goku") and Topic[cid] == 1 then
		selfSay("Goku is east of here, please defeat him! Just open the door. Ask me about {revenge} once you defeat him.", cid)
		setPlayerStorageValue(cid, 30000, 1)
		Topic[cid] = 0
	elseif msgcontains(msg, "revenge") then
		if getPlayerStorageValue(cid, 40000) == 16 then
			selfSay("Thanks a lot, now I can continue with taking over the universe. Here is the supernova technique, have fun!", cid)
			doPlayerLearnInstantSpell(cid, "Supernova")
			-- You need to set another storage here to prevent this from repeating!
		else
			selfSay("What are you lying to me, you monkey!?", cid)
		end
		Topic[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

I suck at npcs -.-
 
ok
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}

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

function greetCallback(cid) Topic[cid] = 0 return true end
function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif msgcontains(msg, "problem") or msgcontains(msg, "mission") or msgcontains(msg, "quest") then
		selfSay("{Goku} defeated me, please take revenge for me.", cid)
		Topic[cid] = 1
	elseif msgcontains(msg, "goku") and Topic[cid] == 1 then
		selfSay("Goku is east of here, please defeat him! Just open the door. Ask me about {revenge} once you defeat him.", cid)
		setPlayerStorageValue(cid, 30000, 1)
		Topic[cid] = 0
	elseif msgcontains(msg, "revenge") then
		if getPlayerStorageValue(cid, 40000) == 16 then
			selfSay("Thanks a lot, now I can continue with taking over the universe. Here is the supernova technique, have fun!", cid)
			doPlayerLearnInstantSpell(cid, "Supernova")
			-- You need to set another storage here to prevent this from repeating!
		else
			selfSay("What are you lying to me, you monkey!?", cid)
		end
		Topic[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

PHP:
function onUse(cid, item, frompos, item2, topos)
    
    if item.uid == 4434 then -- unique id of door
        if setPlayerStorageValue(cid, 30000, 1) == TRUE then
            pos = getPlayerPosition(cid)
            
            if pos.x == topos.x then
                if pos.y < topos.y then
                    pos.y = topos.y + 1
                else
                    pos.y = topos.y - 1
                end
            elseif pos.y == topos.y then
                if pos.x < topos.x then
                    pos.x = topos.x + 1
                else
                    pos.x = topos.x - 1
                end
            else
                doPlayerSendTextMessage(cid,22,'Please stand in front of the door.')
                return 1
            end
            
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
        else
            doPlayerSendTextMessage(cid,22,'You can\'t pass, you didn\'t ask freeza for a mission.')
        end
        return 1
    else
        return 0
    end
	end

PHP:
local bosses = { -- ["name"] = {teleportTo, createPos}
	["goku"] = {{x=1154, y=1195, z=13}, {x=1147, y=1244, z=12}}
}
local event = 0

local function removal(position)
	local get = getTileItemById(position, 1387).uid
	if(get > 0) then
		doRemoveItem(get)
	end
end

function onDeath(cid, corpse, deathList)
	for name, pos in pairs(bosses) do
		if(name:lower() == getCreatureName(cid):lower()) then
			for _, cid in ipairs(deathList) do
				if(isPlayer(cid)) then
					killer = getCreatureMaster(cid) == cid and cid or getCreatureMaster(cid)
					break
				end
			end
			if(killer) then
setPlayerStorageValue(cid, 40000, 16)
        doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'You have avenged for freeza. Go report it to freeza.')
				end
			end
		end
	return true
end

example
Player: hi
frieza: Welcome, PLAYERNAME! I have been expecting you.(it must be Damn you scum leave me alone i have a problem(problem dark blue))
Player: problem or mission
frieza: Goku defeated me, please take revenge for me
Player: Goku
frieza: Goku is east of here, please defeat him! Just open the door. Report me about {revenge} once you defeat him.
Player get storage value
(Walks trough the door and get in tp to a island)
Kill goku (wich haves a lot of hp, so you won't solo the quest without take at least a hour to kill it :) (team quest plxxx))
and if you kill it you get other storage value so if you killed goku and go to freeza

player: hi
frieza: Welcome, PLAYERNAME! I have been expecting you.(it must be Damn you scum leave me alone i have a problem(problem dark blue))
player: revenge
frieza: Thanks a lot, now I can continue with taking over the universe. Here is the supernova technique, have fun.
(And frieza teached you a spell)
or else if you haven't killed it and you say revenge he say
frieza: What are you lying to me, you monkey!?

I have Cryingdamson 0.3.5pl
problems is:
- Everyone can pass the door!
- If you killed goku you won't get storage value
PHP:
[20/02/2010 03:14:09] [Error - CreatureEvent::configureEvent] No valid type for creature event.function
[20/02/2010 03:14:09] [Warning - BaseEvents::loadFromXml] Cannot configure an event
PHP:
	<event type="function" name="Onkill" event="script" value="Onkill.lua"/>

YES I ALSO PUT IT IN LOGIN.LUA
 
Back
Top