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

CreatureEvent Kill Monster & Create Portal

Status
Not open for further replies.
Yea, that will work.
 
What's wrong if i kille example:Arkhothep and it does not create a portal?
 
I changed some stuff in the script, try it now.
 
[09/11/2009 17:21:22] data/creaturescripts/scripts/zugurosh.lua:3: attempt to index global 'config' (a nil value)
[09/11/2009 17:21:22] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/zugurosh.lua)



:/
 
Updated & Working! :thumbup:
 
Same error!

[09/11/2009 17:21:22] data/creaturescripts/scripts/zugurosh.lua:3: attempt to index global 'config' (a nil value)
[09/11/2009 17:21:22] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/zugurosh.lua)

:/
 
Try to rename config table or move it inside function.
 
Try it now, I think it will work.
 
This script seems to never work.
If anyone has a fixed version, PM me.

I will have to work with it later... :blink:
 
This script seems to never work.
If anyone has a fixed version, PM me.

I will have to work with it later... :blink:
Code:
  <event type="kill" name="monsterPortals" [B][COLOR="Red"]event="script"[/COLOR][/B] value="script.lua"/>
Is that also required ?
 
@Topic,
I fixed the script I believe, someone test it if you can.

@Cykotitan,
Yea...thanks.
 
@JDB
Code:
                        tp = doCreateTeleport(1387, pos, position)
                        addEvent(doRemoveItem, tpTime * 1000, tp, 1)
Wrong, you can't do that..
Remere said:
All items change UID between script callbacks. Items are assigned new UIDs each time they're used the first time in a callback.
The only items that retain UID are those with UIDs < 65000 (assigned on map).
You gotta do something more like..
Code:
                        local tp = doCreateTeleport(1387, pos, position)
                        addEvent(doRemoveItem, tpTime * 1000, getTileItemById(position, 1387).uid)
 
Cykotitan, I do appreciate all the help you've given.
Next time maybe we could work on MSN, so problem can be solved fast.

@Topic,
Yea, should work...
 
The Forgotten Server 0.3.5

Credits:
JDB

data/creaturescripts/scripts/login.lua
Lua:
registerCreatureEvent(cid, "monsterPortals")

data/creaturescripts/creaturescripts.xml
Lua:
<event type="kill" name="monsterPortals" event="script" value="script.lua"/>

data/creaturescripts/scripts/script.lua
Lua:
local bosses = {-- Teleport To Position
    ["Morgaroth"] = { x=100, y=100, z=7 },
    ["Orshabaal"] = { x=100, y=100, z=7 },
    ["Ghazbaran"] = { x=100, y=100, z=7 }
}
local tpTime = 30 -- Seconds
function onKill(cid, target, lastHit)
	local position = getCreaturePosition(target)
	for name, pos in pairs(bosses) do
		if name:lower() == getCreatureName(target):lower() then
			doCreateTeleport(1387, pos, position)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. tpTime .." seconds until the portal will disapear.")
			addEvent(doRemoveItem, tpTime * 1000, getTileItemById(position, 1387).uid, 1)
		end
	end
	return true
end


umm there is only a "teleport to position" not a teleport position so it knows where the teleport is xD
 
It creates a teleport at the position of the slain monster.
 
Status
Not open for further replies.
Back
Top