• 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!

(Request) Npc that gives a task

Northnorial

Member
Joined
May 30, 2009
Messages
742
Reaction score
5
Location
Germany
Hiho!

I'm using TFS 0.3.5

I need a NPC, for example called Ryan, that gives you a task, e.g. to kill a boss monster for him ( Now you got the door rights for the boss monster room ), you go kill the boss monster and get a certain item, which you have to give to Ryan and now you have the access to open a door.

Can someone give me a script for this npc ?

Thank you ... :) I'll rep ++
 
Oh, go forgot u used 0.3.5 :p insted of Global.lua, go to "Yourotserv"->data->lib and open functions :p and put that at the end or in the begining.
 
Help!

onlogin.lua

registerCreatureEvent(cid, "WOW_LIKE_QUESTS")

onkill.lua

function onKill(cid, target)
if(isPlayer(target) == FALSE) then
for k, v in pairs(wow_like_quests_storages) do
local storage = getPlayerStorageValue(k)
if(storage >= 0) then
if(storage < v.amount) then
setPlayerStorageValue(cid, k, storage+1)
if(v.on_kill) then
v.on_kill(cid, parameters)
end
end
if((storage+1) == v.amount) then
if(v.on_finish) then
v.on_finish(cid, parameters)
end
end
end
end
end
return TRUE

Where do i find them ?
 
@krille09
No they should exist already.

Help!

onlogin.lua



onkill.lua



Where do i find them ?

You find em at "Yourservername"->data->creaturescripts->scripts
There you should find login.lua
If you don't have login.lua then create it, and put the codes that shall be in there.
Same for onkill.lua

When you have created /edited both, go to the creaturescripts.xml and input this:
Code:
<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
<event type="onkill" name="OnKill" event="script" value="onkill.lua"/>
if any of these already exist in the creaturescript.xml, then you don't need to add it.
 
Ok, login.lua was already existing ... Now I created onkill.lua and put this

<event type="onkill" name="OnKill" event="script" value="onkill.lua"/>

into creaturescripts.xml

If something doesn't work, i'm going to post again.

Thanks for help to both
 
[01/12/2009 17:50:35] [Error - CreatureEvent::configureEvent] No valid type for creature event.onkill
[01/12/2009 17:50:35] [Warning - BaseEvents::loadFromXml] Cannot configure an event

I'm sad about that ...

I already added it into the login.lua
 
Back
Top