Jump to content

[HELP]spawnPlayer


Chrimam

Recommended Posts

It keeps saying

 bad argument @ spawnPlayer 

I tried function getCoords(source) but it says

 bad argument @getElementPosition expected element at argument 1, got number '0' 

(Yes. I also tried spawnCoords(source, wastedX, wastedY, wastedZ, wastedSkin)

function getCoords() 
    wastedX, wastedY, wastedZ = getElementPosition(source) 
        wastedSkin = getElementModel(source) 
            setTimer(spawnCoords, 1000, 1) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), getCoords ) 
  
function spawnCoords(wastedX, wastedY, wastedZ, wastedSkin) 
    spawnPlayer(source, wastedX, wastedY, wastedZ, 0, wastedSkin) 
end 

Link to comment
addEventHandler ( "onPlayerWasted", root, 
    function () 
        wastedX, wastedY, wastedZ = getElementPosition( source ) 
        wastedSkin = getElementModel(source) 
        spawnPlayer(source, wastedX, wastedY, wastedZ, 0, wastedSkin) 
    end 
) 

Link to comment
addEventHandler ( "onPlayerWasted", root, 
    function ( ) 
        wastedX, wastedY, wastedZ = getElementPosition ( source ) 
        wastedSkin = getElementModel ( source ) 
        setTimer ( spawnPlayer, 1000, 1, source, wastedX, wastedY, wastedZ, 0, wastedSkin ) 
    end 
) 

Link to comment
function getCoords() 
    local wastedX, wastedY, wastedZ = getElementPosition(source) 
    local wastedSkin = getElementModel(source) 
    setTimer(spawnCoords, 1000, 1, source, wastedX, wastedY, wastedZ, wastedSkin) 
end 
addEventHandler("onPlayerWasted", root, getCoords) 
  
function spawnCoords(source, wastedX, wastedY, wastedZ, wastedSkin) 
    spawnPlayer(source, wastedX, wastedY, wastedZ, 0, wastedSkin) 
    setCameraTarget(source) 
end 

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...