Jump to content

defining element in function without handlers


Derpy

Recommended Posts

  
-- if server sided 
function health(thePlayer) 
local ppHealth = getElementHealth(thePlayer) 
setElementHealth(thePlayer,ppHealth + 2) 
end 
addCommandHandler("health", health) 
-- if client sided 
function health() 
local ppHealth = getElementHealth(localPlayer) 
setElementHealth(localPlayer,ppHealth + 2) 
end 
  

Link to comment

oh i forgot to mention:

i am trying to work on this in server side because in client i already know how to make it but server side is better

@Anubhav isn't there any other way? im activating that function with a timer, so i must use executeCommandHandler always to force players do something?

Link to comment

its an element as i stated above.

i usually use it for setting specific datas, i will give you an example

when player joins, source is the player who joined

if i set a timer for another function to output message to that player who joined, in that another function, source will be nil

and i would like to be able to retrieve player whenever i want without any handler

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