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

Windows Arena for tfs 0.2 for 8.4

Quickshot

Member
Joined
Nov 8, 2008
Messages
595
Reaction score
8
hi i need a arena script for my server. i want it so more then two people can be in the arena and when you die you go to a certain spot. ill rep if they help me
 
Try this one:
Not tested in 0.2, if this doesnt work post console errors and ill try to make it for 0.2!

PHP:
local arenas = {
{fromPos={x=95, y=128, z=7}, toPos={x=98, y=131, z=7}, arenaLeave={x=94, y=135, z=7}},
{fromPos={x=99, y=131, z=7}, toPos={x=101, y=134, z=7}, arenaLeave={x=94, y=135, z=7}}
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	local tmp = getCreaturePosition(cid)
	for _, arena in ipairs(arenas) do
		if(isInArea(tmp, arena.fromPos, arena.toPos) == TRUE) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by " .. getCreatureName(lastHitKiller) .. ".")
			doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
			doTeleportThing(cid, arena.arenaLeave, TRUE)
			doSendMagicEffect(tmp, CONST_ME_POFF)
			doSendMagicEffect(arenaLeave, CONST_ME_TELEPORT)
			doRemoveCondition(cid, CONDITION_INFIGHT)
			return FALSE
		end
	end
	return TRUE
end
 
were do i add it ?creature scripts?

local arenas = {
{fromPos={x=95, y=128, z=7}, toPos={x=98, y=131, z=7}, arenaLeave={x=94, y=135, z=7}},
{fromPos={x=99, y=131, z=7}, toPos={x=101, y=134, z=7}, arenaLeave={x=94, y=135, z=7}}
this is different than other scripts i have seen most of them just have one line yours has 2 how do i put the xyz coordinates in
 
Yeah in creaturescript, add this in .xml

PHP:
<event type="arena" name="Kill" script="arena.lua"/>

And remember to add the registerEvent in login.lua.

My Script has 2 lines because you can add more than 1 arena in just one script :D
 
Back
Top