Jump to content

Need CODE


ghassen14

Recommended Posts

function binds() 
  bindKey(key, state, onWaste) 
end 
addEventHandler("onClientResourceStarts", getResourceRootElement(getThisResource()), binds) 
  
function onWaste() 
    setElementPosition(localPlayer, x, y, z) 
end 
addEventHandler("onClientPlayerWasted", getRootElement(), onWaste) 

that is more les in client side if you wanrt it in server side just tell me key state and position you choose

Link to comment
function binds() 
  bindKey(key, state, onWaste) 
end 
addEventHandler("onClientResourceStarts", getResourceRootElement(getThisResource()), binds) 
  
function onWaste() 
    setElementPosition(localPlayer, x, y, z) 
end 
addEventHandler("onClientPlayerWasted", getRootElement(), onWaste) 

that is more les in client side if you wanrt it in server side just tell me key state and position you choose

WHAT I WRITE IN CLIENT AND SERVER PLS

Link to comment
WHAT I WRITE IN CLIENT AND SERVER PLS
You can stop writing in capital letters, for a start.

The code which Dimos7 sent is client-side but you need to define the position, key & state (see below) beforehand, otherwise it won't work.

local x, y, z = --the co-ordinates where you want people to respawn at 
local key = --the key to press to respawn 
local state = --whether the above key should be pressed or released, "down" or "up" accordingly. 
  
--place before Dimos7's code 

Link to comment

if you meant every team should have their own spawn then use this!

use getTeamFromName().

here is the example.

  
function binds() -- Made a bind event 
  bindKey(s, "down", onWaste) --  You made a bind 
end 
addEventHandler("onClientResourceStarts", getResourceRootElement(getThisResource()), binds) 
  
     function onWaste() -- Now this is the main function. 
 team1 = getTeamFromName("tdm1") -- Remember! If you want to specify a team in those parenthesis then the team "should" actually exist else it won't recognize it . 
 team2 = getTeamFromName("tdm2") -- Team2 won't be necessary but I am going to tell you a bit in beginner style. 
  
if team1 then  
         setElementPosition(localPlayer, x, y, z )  
 else  
         setElementPosition(localPlayer, l, m, n )  
                        end  
             end  
addEventEventHandler("onClientPlayerWasted", getRootElement(), onWaste) 
  

I am not too good in Lua, sorry if I made many mistakes.

Link to comment
if you meant every team should have their own spawn then use this!

use getTeamFromName().

here is the example.

  
function binds() -- Made a bind event 
  bindKey(s, "down", onWaste) --  You made a bind 
end 
addEventHandler("onClientResourceStarts", getResourceRootElement(getThisResource()), binds) 
  
     function onWaste() -- Now this is the main function. 
 team1 = getTeamFromName("tdm1") -- Remember! If you want to specify a team in those parenthesis then the team "should" actually exist else it won't recognize it . 
 team2 = getTeamFromName("tdm2") -- Team2 won't be necessary but I am going to tell you a bit in beginner style. 
  
if team1 then  
         setElementPosition(localPlayer, x, y, z )  
 else  
         setElementPosition(localPlayer, l, m, n )  
                        end  
             end  
addEventEventHandler("onClientPlayerWasted", getRootElement(), onWaste) 
  

I am not too good in Lua, sorry if I made many mistakes.

So can you give me code of a little Messge ( Press a to Respawn )

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