Jump to content

[help] how to disable random skin in spawn?


Recommended Posts

addEventHandler("onResourceStart", resourceRoot, 
    function() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 
    repeat until spawnPlayer ( player, 2412+math.random(1,1), -1413+math.random(1,1),24.4, 90, math.random(9,288) ) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
end 
  
addEventHandler("onPlayerJoin", 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 
) 

Replace it with your .lua file inside "play" ;) Should work

Link to comment
addEventHandler("onResourceStart", resourceRoot, 
    function() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 
    repeat until spawnPlayer ( player, 2412+math.random(1,1), -1413+math.random(1,1),24.4, 90, math.random(9,288) ) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
end 
  
addEventHandler("onPlayerJoin", 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 
) 

Replace it with your .lua file inside "play" ;) Should work

thanks.. but when I die, I respawn in other place (LS)

I want to respawn in SF.. how I can do it?

Link to comment

Change the following part:

  
function spawn(player) 
    repeat until spawnPlayer ( player, 2412+math.random(1,1), -1413+math.random(1,1),24.4, 90, math.random(9,288) ) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 

The numberic part is the place you spawn. Change these coordinates:

2412+math.random(1,1), -1413+math.random(1,1),24.4, 90 

Link to comment
Change the following part:
  
function spawn(player) 
    repeat until spawnPlayer ( player, 2412+math.random(1,1), -1413+math.random(1,1),24.4, 90, math.random(9,288) ) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 

The numberic part is the place you spawn. Change these coordinates:

2412+math.random(1,1), -1413+math.random(1,1),24.4, 90 

thanks.. it works

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