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

[TFS 0.3.5pl1][CreatureEvent][Solved] How work function onTarget and ...

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
549
Solutions
6
Reaction score
124
Location
player:getTown()
1. How work function onTarget? When creature is target then (make code) or when creature get damage then (make code)?

2. How write line to XML part?
PHP:
<event type="target" name="PetTarget" event="script" value="pettarget.lua"/>
It's correct?

#EDIT#
In creatureevent.cpp I found "target" with other event type, so propably line in xml are fine.
 
Last edited:
Solution
Event types for xml:
Code:
target
statschange

Funcs:
Code:
function onTarget(cid, target)
	return true
end

Code:
function onStatsChange(cid, attacker, type, combat, value)
	return true
end
Event types for xml:
Code:
target
statschange

Funcs:
Code:
function onTarget(cid, target)
	return true
end

Code:
function onStatsChange(cid, attacker, type, combat, value)
	return true
end
 
Solution
Back
Top