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

Kill vampire, start addEvent

kokokoko

Veteran OT User
Joined
Feb 4, 2008
Messages
921
Reaction score
257
This doesn't work, have no idea why(gheheh forgot to write this lol)

creaturescripts.xml
Code:
<event type="login" name="login" script="login.lua" />
<event type="kill" name="kill1" script="kill1.lua"/>

kill1.lua
Code:
function onKill(cid, target)
pos = getPlayerPosition(cid)

	if getPlayerStorageValue(cid, 10000) < 1 then
		if(getCreatureName(target) == "Vampire") then
				setPlayerStorageValue(cid, 10000, 1)
				doPlayerSendTextMessage(cid, 22, "You will proceed in 30seconds. Prepare to die!!")
					addEvent(t, 1000*5, {cid = cid})
			end
	end
	return TRUE
end

function t(parameters)

newPos = {x=893, y=1133, z=8}
oldPos = getPlayerPosition(parameters.cid)

doTeleportThing(parameters.cid, newPos)
animation(newPos, 10)
animation(oldPos, 10)
end

login.lua
Code:
function onLogin(cid)
if getPlayerStorageValue(cid, 10000) < 1 then
	registerCreatureEvent(cid, "kill1")
	end
return 1
end

By the way, i made the function animation(), so that's not wrong. (Its the same as doSendMagicEffect() )

Thanks in advance,
//Kokokoko
 
Last edited:
Code:
<event type="kill" name="kill1" script="kill1.lua"/>

i think....should be
Code:
<event type="ondeath" name="kill1" script="kill1.lua"/>
 
Back
Top