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

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

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

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

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