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

Event type "Think" isn't working

mikeware

New Member
Joined
Jul 17, 2007
Messages
338
Reaction score
0
Location
Brazil
Hey folks
Found a bug(?) at the TFS 2.0, scripts from the think event type at creaturescripts.xml isn't working, it was working before, the last TFS I was using was 2.10.

tested a simple script just to check if its working or not and nothing happens
 
Maybe there is no registered creature to execute this event?

the script should be working, but its not..
I made a simple script just to check and nothing happens:
testthink.lua:
Code:
function onThink(cid)
doCreatureSay(cid, 'test',1)
end


at creaturescripts.xml:
Code:
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>
<event type="logout" name="PlayerLogout" script="logout.lua"/>
<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
<event type="think" name="PlayerThink" script="testthink.lua" />
</creaturescripts>
 
Help please, think event types don't working at creaturescripts :D
 
I don't think there's any onThink function for creaturescripts, that's for NPCscripts only I think.
 
I don't think there's any onThink function for creaturescripts, that's for NPCscripts only I think.

there is, I used it at TFS 2.10, now I switched to TFS 0.2 and its not working, but if u look at the creatureevent.cpp you will see it have this event type, there are some others too.
 
Signed, onThink doesnt work for me too, I want to try nillers onAdvance system but it isnt working..
 
Maybe you did something wrong? I tested on rev. 1074 and onThink work.
data/creaturescripts/scripts/creaturescripts.xml:
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" script="login.lua"/>
	<event type="login" name="FirstItems" script="firstitems.lua"/>
	<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
	<event type="think" name="PlayerThink" script="think.lua"/>
</creaturescripts>
data/creaturescripts/scripts/think.lua:
PHP:
function onThink(cid)
print("LOL")
end
data/creaturescripts/scripts/login.lua:
PHP:
function onLogin(cid)
	registerCreatureEvent(cid, "PlayerThink")
	registerCreatureEvent(cid, "PlayerDeath")
	return TRUE
end
registerCreatureEvent(cid, "PlayerThink")
It show text "LOL" in server console.
 
Back
Top