iSamukaOP Posted July 8, 2023 Posted July 8, 2023 Queria que nesse script de respawn a tela do jogador quando morresse fizesse aquela animação da tela subindo até ele renascer. local groups = { { name = "Everyone", spawnData = locaisHospital } } locaisHospital = { [1] = {1177.546, -1323.826, 14.076}, [2] = {1177.546, -1323.826, 14.076}, [3] = {1177.546, -1323.826, 14.076}, [4] = {1177.546, -1323.826, 14.076}, } local function Skin( ) if eventName == 'onPlayerSpawn' then local nData = getElementData( source, 'save-skin' ) if nData then setElementModel( source, nData ) end else setElementData( source, 'save-skin', getElementModel( source ) ) end end addEventHandler( 'onPlayerWasted', root, Skin ) addEventHandler( 'onPlayerSpawn', root, Skin ) function spawn( player ) if not player or not isElement(player) or getElementType(player) ~= "player" then return end local spawned = false local acc = getPlayerAccount( player ) for i=1, #groups do if isObjectInACLGroup ( "user."..getAccountName(acc), aclGetGroup (groups[i].name)) then spawned = spawnPlayer ( player, unpack(locaisHospital [math.random (#locaisHospital)])) end end if spawned ~= true then spawnPlayer (player, unpack(locaisHospital [math.random (#locaisHospital)])) end showChat( player, true ) fadeCamera( player, true ) setCameraTarget( player, player ) end addEventHandler( "onResourceStart", resourceRoot, function() resetMapInfo() for _,player in ipairs( getElementsByType 'player' ) do spawn( player ) end end ) addEventHandler( "onPlayerJoin", root, function( ) spawn(source) givePlayerMoney ( source, 5000 ) setTimer(spawn, 0, 1, source) end) addEventHandler( "onPlayerWasted", root, function( ) setTimer( spawn, 0, 1, source ) end) o jogador morre e renasce na mesma hora
Moderators Lord Henry Posted July 11, 2023 Moderators Posted July 11, 2023 Por padrão, o gamemode Play já faz isso. A não ser que você use outro gamemode ou edite o gamemode Play para ele não fazer mais esse efeito. No seu script isso não acontece pois você está respawnando o jogador no mesmo instante em que ele morre. Então a tela não faz isso pois o jogador já renasceu antes do efeito começar. O efeito só acontece enquanto jogador está morto. Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now