Jump to content

'Respawn' Skin 0


Recommended Posts

4 hours ago, Kaio Bruno Silveira said:

quando o cara morre ele nao ta nascendo com  a skin que ele tava antes,Alguem Sabe resolver??
 


ultimaSkin = {}

function morrerUltimaSkin()
	local skin = getElementModel(source)
	ultimaSkin[source] = skin
	local lastSkin = ultimaSkin[source]
	if ultimaSkin[source] then
		setTimer(setElementModel, 3000, 1, source, lastSkin)
		ultimaSkin[source] = nil
	end
end
addEventHandler ( "onPlayerWasted", root, morrerUltimaSkin )

Tente user este codigo (server.lua)

Link to comment

Veja se funciona assim:

--server-side
function Wasted()
	setElementData(source, 'Skin', getElementModel(source))
end
addEventHandler ( "onPlayerWasted", root, Wasted )

function Spawn()
  	local skin = getElementData(source, 'Skin') or 0
    setElementModel(source, skin)
end
addEventHandler("onPlayerSpawn", root, Spawn) -- This will exec every time a Player spawn

 

Edited by Boechat
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...