blurryshadow1 Posted October 10, 2011 Posted October 10, 2011 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
Castillo Posted October 10, 2011 Posted October 10, 2011 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)
blurryshadow1 Posted October 10, 2011 Author Posted October 10, 2011 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)
blurryshadow1 Posted October 10, 2011 Author Posted October 10, 2011 can someone help me identify the problem?
SDK Posted October 10, 2011 Posted October 10, 2011 It's probably another script messing around, since this one seems to be fine. My guess is that that other script is also trying to spawn the player, with a timer after onPlayerWasted. Check whatever resources you have running
^Dev-PoinT^ Posted October 10, 2011 Posted October 10, 2011 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)
blurryshadow1 Posted October 11, 2011 Author Posted October 11, 2011 i dont see any errors.... edit: wooooow all i had to do was change the event handler at the bottom to onPlayerSpawn instead of onPlayerWasted
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now