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

mod request

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
i need a mod that if player have town id 5 he allow to this mode
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Respawn_Module" version="2.0" author="Syntax" contact="[email protected]" enabled="yes">
    <config name="respawn_config"><![CDATA[
        config = {
			masterpos = true, -- set to true if you want them teleported to their home town
			townid = 5, -- if masterpos is false then set for custom town or set to 0 for custom position
			position = {x = 1231, y = 988, z = 8}
        }
 ]]></config>
	<event type="login" name="Respawn_login" event="buffer"><![CDATA[
		registerCreatureEvent(cid, "Respawn_status")
]]></event>
	<event type="statschange" name="Respawn_status" event="script"><![CDATA[
	domodlib('respawn_config')
		function onStatsChange(cid, attacker, type, combat, value)
			if type == 1 and getCreatureHealth(cid) <= value then
				pos = config.position
				if(config.masterpos)then
					pos = getPlayerMasterPos(cid)
				elseif config.townid > 0 then
					pos = getTownTemplePosition(config.townid)
				end
				doTeleportThing(cid, pos)
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) 
				return false
			end
			return true
		end
]]></event>
</mod>
or make it all in 1 mod
 
Back
Top