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

FAIL: World's simplest script

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,018
Solutions
1
Reaction score
1,040
Location
United States
LUA:
function onKill(cid, target, lastHit)
monsterPos = getCreaturePosition(target)
        if isPlayer(cid) and (getCreatureName(target):lower() == "rat") then
        doSendAnimatedText(monsterPos, "KILL!", TEXTCOLOR_ORANGE)
        end
    return TRUE
end

Not working, anyone got thoughts?
 
I checked it and it worked.

Did you register it in login.lua?
Creaturescripts.xml
XML:
	<event type="kill" name="MonsterKill" script="kill.lua"/>

Login.lua
LUA:
	registerCreatureEvent(cid, "MonsterKill")
 
@ruda, thats my only onKill function I am using.


Here's a pic of everything:

333hksy.png


NO ERRORS IN CONSOLE.
 
try this ONLY to check if the function is being called:

Code:
function onKill(cid, target, lastHit)
monsterPos = getCreaturePosition(target)
        doSendAnimatedText(monsterPos, "KILL!", TEXTCOLOR_ORANGE)
    return TRUE
end
 
Okay, yeah it works now.

I just restarted my server to see if that did anything,
so, unfortunately, /reload creaturescript does not work.

Thanks man
 
Back
Top