Jump to content

[HELP] Please


1LoL1

Recommended Posts

Please how to fix this script? not work :(

local spawnX, spawnY, spawnZ = 2494.6000976563, -1692.5, 25.39999961853 
local skin = 287 
function joinHandler() 
             spawnPlayer(source, spawnX, spawnY, spawnZ)     
             fadeCamera(source, true) 
    setCameraTarget(source, source) 
end 
addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 
  
local spawnX, spawnY, spawnZ = 2494.6000976563, -1692.5, 25.39999961853 
local skin = 287 
function deadHandler() 
             spawnPlayer(source, spawnX, spawnY, spawnZ, spawnSkin) 
             fadeCamera(source, true) 
    setCameraTarget(source, source) 
end 
addEventHandler("onPlayerWasted", getRootElement(), deadHandler) 

Link to comment
Check the following:

  • Do /debugscript 3 and see if you get any errors
  • Make sure this is running on the server side (type="server" in meta.xml)
  • Line 10 and 11 does the same as 1 and 2, remove 10 and 11.

only

but i want only when i joined the server skin - 287 and when i dead i spawn with skin 287.

Link to comment

There you go:

local spawnX, spawnY, spawnZ = 2494.6000976563, -1692.5, 25.39999961853 
local skin = 287 
function joinHandler() 
    spawnPlayer(source, spawnX, spawnY, spawnZ, 90, skin)    
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
end 
addEventHandler("onPlayerJoin", root, joinHandler) 
  
function deadHandler() 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    setTimer(spawnPlayer, 2000, 1, source, spawnX, spawnY, spawnZ, 90, skin) 
end 
addEventHandler("onPlayerWasted", root, deadHandler) 

To set skin with spawnPlayer function, you gotta pass another optional argument "Set Rotation" which comes before setting skin, then you can set the model ID which will be applied after spawning.

Link to comment
There you go:
local spawnX, spawnY, spawnZ = 2494.6000976563, -1692.5, 25.39999961853 
local skin = 287 
function joinHandler() 
    spawnPlayer(source, spawnX, spawnY, spawnZ, 90, skin)    
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
end 
addEventHandler("onPlayerJoin", root, joinHandler) 
  
function deadHandler() 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    setTimer(spawnPlayer, 2000, 1, source, spawnX, spawnY, spawnZ, 90, skin) 
end 
addEventHandler("onPlayerWasted", root, deadHandler) 

To set skin with spawnPlayer function, you gotta pass another optional argument "Set Rotation" which comes before setting skin, then you can set the model ID which will be applied after spawning.

Thanks you very much man!!! :D

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