Jump to content

Ajuda respawn


Recommended Posts

Olá,

Então galera no meu script quando o player loga no servidor ele nasce na base do team dele, ai quando ele morre  ele nasce na base do team denovo, eu queria uma dica de como faço para ele quando morrer nascer em um hospital,    no caso cada team nasce em um hospital diferente quando morrer

function spawner()
	setTimer(function(source)
	local teamCoords = coords[getTeamName(getPlayerTeam(source))]
	local rndN = 0
	if teamCoords then
		rndN = math.random(1,#teamCoords)
		setElementPosition(source, teamCoords[rndN][1], teamCoords[rndN][2], teamCoords[rndN][3])
	else
		rndN = math.random(1,#novato)
		setElementPosition(source, novato[rndN][1], novato[rndN][2], novato[rndN][3])
	end
	end,1000,1,source)
end
addEventHandler("onPlayerSpawn",getRootElement(),spawner)
------
------
function getSpawnSede (thePlayer)
	if (thePlayer) then
		if (getPlayerTeam(thePlayer)) then
			if (coords[getTeamName(getPlayerTeam(thePlayer))][1]) then
				return coords[getTeamName(getPlayerTeam(thePlayer))][1], coords[getTeamName(getPlayerTeam(thePlayer))][2], coords[getTeamName(getPlayerTeam(thePlayer))][3] 
			end
		end
	end
end


setOcclusionsEnabled( false )

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...