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

Battlefield teams.

Antrhaxcs

New Member
Joined
Aug 8, 2007
Messages
247
Reaction score
0
Location
Venezuela
Hello...
I wonder if someone could help me:

I want make an scrip who teleport all players located in (x,y,z)
to (x1,y1,z1) each 30 minutes and when all players of the opposite team died teleport the last standing players to temple again.

Ej: I have a normal pvp world
But since the "battle arena" isn't in use... (cuz nobody care about arena... just go to random pk and done -.-)

I want each 30 min the server broad cast battle arena opened in 1 minute
so all player go to the start room and wait.. when the minute of waiting is done all players located in the Start room get teleported to the battlefield, the teams are divided by sex, and when all player male or female died, the standing palyers go teleported to a room with a reward. Can someone say me if this is possible by lua functions or I need to work in the sources?
 
I guess thats possible wht a lua functions... make a NPC with a onthink function, and each 30minutes he actives a trigger... make the trigger global and make a script in creaturescripts to check if a player is in a located place and the trigger is on them he teleports..
 
make a npc script with that function:
Code:
function onThink()

if thinkState ~= 1 then
		osTime = os.time()
		thinkState = 1
end
		if os.difftime (os.time(), osTime) == (1800) and (SWITCH == FALSE) then
				SWITCH = TRUE
				osTime = os.time()
		end
end

now make a script in creaturescripts like that:
Code:
local places =
{
		fromPosition = {x=?, y=?, z=?},
		toPosition = {x=?, y=?, z=?}

}

function onThink(cid)
if (SWITCH == TRUE) then
	if isInPosition(getCreaturePosition(cid), places.fromPosition, places.toPosition) then
		doTeleportThing(cid, {x=?, y=?, z=?}, TRUE)
		SWITCH = FALSE
	else
	return true
	end
end
end

so every 30minute, the players that are in the selected position, will be teleported to another place and the time ill restart, very simple...

add this line in creatuerscripts.xml
Code:
<event type="think" name="PlayerThink" script="scriptname.lua" />

don't forget to add this line in GLOBAL.lua

Code:
SWITCH = FALSE

obs: remeber to change the position and the names of the scripts, also add the npc somewhere the players can't access
 
Last edited:
hmm, i don't if this works, but in my server, to make an bless castle i maked the are of castle an PVP ARENA and the exit its the enter of he, when teh player dies, come back to front door with no losts :D
 
Back
Top