Jump to content

Set certain skin when player spawn


Kors

Recommended Posts

Posted

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 
) 

 

Posted

Last argument, change math.random(9,288) to 72.

  • Thanks 1

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
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 
) 

 

 

RPG/CnR servers Developer , You want help ? contact me on discord >>>lilDawage#8508<<< i'm at your Service 10/24 hours 7/7 days , >>>Welcome<<<

Asking Discord Channel JOIN US ON here , you are welcome 10/24 active

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