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

[Req] New Lua Function

muphet

New Member
Joined
Apr 27, 2008
Messages
233
Reaction score
2
Hi. I need to add new lua function to my server, but I don't know how to implement that. Any tutorials/help?

I need to add onDamage or something like that:
if player got any damage~

Rep for help!
 
I'm thinkin' about it, but my brain is too disturbed. How can I use that in script?

Code:
function onStatsChange(cid, attacker, type, combat, value)

vocations = {11}
	
	if(isInArray(vocations, getPlayerVocation(cid))) then
	if(getPlayerGroupId(cid) == 2) then
And what now? How to add it: if player got anydamage(dmg>0) then~

/I'm not good scripter, just learning.. :p
 
Code:
local vocations = {11}
function onStatsChange(cid, attacker, type, combat, value)
	if type == STATSCHANGE_HEALTHLOSS and isInArray(vocations, getPlayerVocation(cid)) and getPlayerGroupId(cid) == 2 then
		--
	end
	return true
end
 
Ah.. Cykotitan, can you tell me, where I can use that? xP
Creaturescripts not working.

Code:
local vocations = {11}
function onStatsChange(cid, attacker, type, combat, value)
	if type == STATSCHANGE_HEALTHLOSS and isInArray(vocations, getPlayerVocation(cid)) and getPlayerGroupId(cid) == 2 then
		doPlayerSetGroupId(cid, 1)
		doCreatureChangeOutfit(cid, Out)
		doChangeSpeed(cid, 60)
		doSendMagicEffect(getCreaturePosition(cid), 2)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are visible now.")
	end
	return true
end
 
Last edited:
Back
Top