Jump to content

Why not working this script?


Turbe$Z

Recommended Posts

Posted
function stats(thePlayer)
setPlayerStat ( player, 24, 1000 )
setElementHealth( thePlayer, 200 )
end
addEventHandler("onPlayerJoin", stats)

what wrong ??

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
2 minutes ago, Gravestone said:

The second argument of addEventHandler is the element the handler should be attached to. 'root' is a predefined variable which gets the root element of any function. Use this:


addEventHandler("onPlayerJoin", root, stats)

Visit addEventHandler for more information.

i added "root," but doesn't working :S

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
11 minutes ago, Gravestone said:

Oh, setPlayerStat is deprecated, use  setPedStat instead.

function stats(thePlayer)
setPedStat ( thePlayer, 24, 1000 )
setElementHealth( thePlayer, 200 )
end
addEventHandler("onPlayerJoin", root, stats)

still not working :c

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted (edited)
function stats()
    setPedStat (source, 24, 1000)
    setElementHealth(source, 200)
end
addEventHandler("onPlayerJoin", root, stats)

The source of this event is the player who joined.

Edited by Walid

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
1 minute ago, Walid said:

function stats()
	setPedStat (source, 24, 1000)
	setElementHealth(source, 200)
end
addEventHandler("onPlayerJoin", root, stats)

The source of this event is the player who joined.

Ohh thanks man :DDD

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
1 minute ago, Turbo777 said:

Ohh thanks man :DDD

np

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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