Jacobob14 Posted April 22, 2014 Posted April 22, 2014 help what is the problem: ( addEventHandler("onPlayerJoin", getRootElement(), function (player) local accountName = getAccountName ( getPlayerAccount ( player ) ) if accountName== "guest" then setElementData(player, "level", 1) setElementData(player, "exp", 0) end end )
justn Posted April 22, 2014 Posted April 22, 2014 addEventHandler("onPlayerJoin", getRootElement(), function (player) if getAccountName(getPlayerAccount(player) == "guest" ) then setElementData(player, "level", 1) setElementData(player, "exp", 0) end end)
Jacobob14 Posted April 22, 2014 Author Posted April 22, 2014 addEventHandler("onPlayerJoin", getRootElement(), function (player) if getAccountName(getPlayerAccount(player) == "guest" ) then setElementData(player, "level", 1) setElementData(player, "exp", 0) end end) error http://prntscr.com/3c9hmb
Controlled Posted April 22, 2014 Posted April 22, 2014 addEventHandler("onPlayerJoin", getRootElement(), function (client) if getAccountName(getPlayerAccount(client) == "guest" ) then setElementData(client, "level", 1) setElementData(client, "exp", 0) end end) Try that.
Jacobob14 Posted April 22, 2014 Author Posted April 22, 2014 (edited) http://prntscr.com/3c9hmb ( Edited April 22, 2014 by Guest
Controlled Posted April 22, 2014 Posted April 22, 2014 http://prntscr.com/3c9lfg( That means its returning "false" for the account that the player has. So the player is not bound to a account in that case. At least thats what I think it is. A more experienced scripter might know more but thats my guess.
justn Posted April 22, 2014 Posted April 22, 2014 addEventHandler("onPlayerJoin",getRootElement(), function () playerAccountName = getPlayerAccount(source) if isGuestAccount(playerAccountName) then setElementData(source, "level", 1) setElementData(source, "exp", 0) end end)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now