Jump to content

Set certain skin when player spawn


Kors

Recommended Posts

How to add skin 72 ,not random, only 72 
 

addEventHandler("onResourceStart", resourceRoot, 
    function() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 

    repeat until spawnPlayer ( player, -728.69219970703+math.random(1,1), 1547.8328857422+math.random(1,1),38.977741241455, 90, math.random(9,288) ) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
end 
  
addEventHandler("onPlayerLogin", root, 
    function() 
        spawn(source) 

    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function() 
                local skin = getElementModel ( source ) 
        setTimer(spawn, 1800, 1, source) 
               setTimer(setElementModel, 1800, 1, source, skin) 
    end 
) 

 

Link to comment
1 hour ago, Kors said:

How to add skin 72 ,not random, only 72 
 


addEventHandler("onResourceStart", resourceRoot, 
    function() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 

    repeat until spawnPlayer ( player, -728.69219970703+math.random(1,1), 1547.8328857422+math.random(1,1),38.977741241455, 90,72 ) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
end 
  
addEventHandler("onPlayerLogin", root, 
    function() 
        spawn(source) 

    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function() 
                local skin = getElementModel ( source ) 
        setTimer(spawn, 1800, 1, source) 
               setTimer(setElementModel, 1800, 1, source, skin) 
    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...