Jump to content

random skin when player respawns? how?


blurryshadow1

Recommended Posts

i got it to spawn you with a random skin when you login but now i cant figure out how to make it so when you die and respawn you get a random skin.. its always just cj when you respawn.

heres what i got.... (btw im a noob at scripting)

function onPlayerSpawn ( ) 
    spawnPlayer (source, 1993.8115234375, -2446.26171875, 13.546875, 0.00274658203125, math.random (0,288), 0, 0, spawnTeam) -- spawns player with random skin 
end 

Link to comment

oh wow i was just one line off... but now the problem is that when they respawn its the random skin then seconds later its cj again.

i think somewhere in the freeroam script its making the player spawn as cj, and so the scripts are colliding with eachother

edit: its not freeroam... now i dont know whats the problem..... well heres my whole spawning script

function spawnOnLogin (prevA, curA, autoLogin) 
    outputChatBox ("Welcome to Veteran Stunt Server!", source, 255, 0, 0, false) 
    spawnPlayer (source, 1993.8115234375, -2446.26171875, 13.546875, 0.00274658203125, math.random (0,288), 0, 0, spawnTeam) -- spawns player with random skin 
    fadeCamera (source, true) 
    setCameraTarget (source, source) 
end 
addEventHandler("onPlayerLogin", getRootElement(), spawnOnLogin) 
  
function onPlayerSpawn ( ) 
    spawnPlayer (source, 1993.8115234375, -2446.26171875, 13.546875, 0.00274658203125, math.random (0,288), 0, 0, spawnTeam) -- spawns player with random skin 
end 
addEventHandler("onPlayerWasted",root,onPlayerSpawn) 

Link to comment

Use /debugscript 3 and tell us what is ther errors

function spawnOnLogin (prevA, curA, autoLogin) 
    outputChatBox ("Welcome to Veteran Stunt Server!", source, 255, 255, 0, false) 
    spawnPlayer (source, 1993.8115234375, -2446.26171875, 13.546875, 0.00274658203125, math.random (0,288), 0, 0, spawnTeam) 
    fadeCamera (source, true) 
    setCameraTarget (source, source) 
    setPlayerSkin(playerSource, 0,280) 
end 
addEventHandler("onPlayerLogin", getRootElement(), spawnOnLogin) 
  
function onPlayerSpawn ( ) 
    spawnPlayer (source, 1993.8115234375, -2446.26171875, 13.546875, 0.00274658203125, math.random (0,288), 0, 0, spawnTeam)  
    setPlayerSkin(playerSource, 0,280) 
end 
addEventHandler("onPlayerWasted",root,onPlayerSpawn) 

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