JeViCo Posted September 29, 2018 Share Posted September 29, 2018 Hello everyone. Does somebody know why? Wiki says that source of that event is a player but it doesn't work for some reason. Simple example (the second one works while the first one is not) addEventHandler("onPlayerSpawn",root,function() outputChatBox(tostring(getAccountID(getPlayerAccount(source)))) end) addCommandHandler("getID",function(p) outputChatBox(tostring(getAccountID(getPlayerAccount(p)))) end) Link to comment
iMr.WiFi..! Posted September 29, 2018 Share Posted September 29, 2018 9 minutes ago, JeViCo said: Hello everyone. Does somebody know why? Wiki says that source of that event is a player but it doesn't work for some reason. Simple example (the second one works while the first one is not) addEventHandler("onPlayerSpawn",root,function() outputChatBox(tostring(getAccountID(getPlayerAccount(source)))) end) addCommandHandler("getID",function(p) outputChatBox(tostring(getAccountID(getPlayerAccount(p)))) end) You need to check if he has an account. Link to comment
JeViCo Posted September 30, 2018 Author Share Posted September 30, 2018 12 hours ago, iMr.WiFi..! said: You need to check if he has an account. account existed i replaced it with onPlayerLogin event and solved my problem. Thanks anyway Link to comment
LilDawage Posted October 10, 2018 Share Posted October 10, 2018 addEventHandler("onPlayerSpawn",root,function() outputChatBox(tostring(getAccountID(getPlayerAccount(source)))) end) this bro Try to make source identified addEventHandler("onPlayerSpawn",root,function(p) Link to comment
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