Jump to content

Some Help in Respawn


^Dev-PoinT^

Recommended Posts

Hi i made this

function res () 
    local x, y, z = getElementPosition(source) 
    outputChatBox("Respawn after 5 seconed...", getRootElement(), 255, 255, 0, true) 
    setTimer (spawnPlayer, 5000, 1, source, x, y, z, 0, math.random(0,200) ) 
    setGameSpeed(tonumber(0.4)) 
end 
addEventHandler( "onPlayerWasted", getRootElement( ), res ) 

how to Make gameSpeed Back to normal after Player Spawn :)

Link to comment

First of all.

This script will set all players' game speed. You should make it client + server:

CLIENT:

function res ( ) setGameSpeed ( 0.4 ) end 
addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), res ) 

SERVER:

function res ( ) 
    local x, y, z = getElementPosition ( source ) 
    outputChatBox ( "Respawn after 5 seconds...", source, 255, 255, 0, true ) 
    setTimer ( spawnPlayer, 5000, 1, source, x, y, z, 0, math.random ( 0,200 ) ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement( ), res ) 

------

About the restoring game speed:

CLIENT:

function res ( ) setGameSpeed ( 1 ) end 
addEventHandler( "onClientPlayerSpawn", getLocalPlayer( ), res ) 

Link to comment

Like Thx?

serverSide ---

function res ( ) 
    local x, y, z = getElementPosition ( source ) 
    outputChatBox ( "Respawn after 5 seconds...", source, 255, 255, 0, true ) 
    setTimer ( spawnPlayer, 5000, 1, source, x, y, z, 0, math.random ( 0,200 ) ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement( ), res ) 

clientSide -----

function res ( ) setGameSpeed ( 0.4 ) end 
addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), res ) 
  
function res ( ) setGameSpeed ( 1 ) end 
addEventHandler( "onClientPlayerSpawn", getLocalPlayer( ), res ) 

Link to comment
function res ( ) 
    local x, y, z = getElementPosition ( source ) 
    outputChatBox ( "Respawn after 5 seconds...", source, 255, 255, 0, true ) 
    setTimer ( spawnPlayer, 5000, 1, source, x, y, z, 0, math.random ( 0,200 ), getElementModel(source) ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement( ), res ) 

Link to comment
function res ( ) 
    local x, y, z = getElementPosition ( source ) 
    outputChatBox ( "Respawn after 5 seconds...", source, 255, 255, 0, true ) 
    setTimer ( spawnPlayer, 5000, 1, source, x, y, z, 0, getElementModel(source) ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement( ), res ) 

Link to comment

i fixed it with this :)

its Nice to fix things By Yourself :)

thx You all for help me :)

function res ( ) 
    outputChatBox ( "Respawn after 5 seconds...", source, 255, 255, 0, true ) 
    setTimer ( spawnPlayer, 5000, 1, source, x, y, z, 0, getElementModel(source) ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement( ), res ) 

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