|
| 20 Jun 2015 09:10 AM |
| Because what if someone put guest in their name..? |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:12 AM |
IIRC, guests name's are a specific way..
"Guest ####"
There's always a space between the numbers and guest. Not sure if it's still that way, but there you go. I also remember they have something different with they userId. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:14 AM |
| if Player.UserId == -1 then |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:15 AM |
Guest's don't have a positive userId so just check if it's -1.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:15 AM |
Another alternative(s) would be:
if string.find(Player.Name, "Guest ") then if string.sub(Player.Name, 1, 6) == "Guest " then |
|
|
| Report Abuse |
|
|
jode6543
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 5363 |
|
|
| 20 Jun 2015 09:22 AM |
I'm not sure if it is -1 exactly, but their user id is always negative. So: if player.userId < 0 then --it's a guest, or a test player end |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:35 AM |
"Guest's don't have a positive userId so just check if it's -1."
Actually, their userId is negative, not -1. Each guest has a negative Id based on a cookie in their browser, and the guest's name is Guest plus the last four digits of the Id. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:51 AM |
if string.find("Guest 1234", "Guest (%d+)") then --Guest else --Player end |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:54 AM |
@Jarod That's not entirely correct:
http : / / postimg . org / image / 8nnpgdlj3 / http : / / postimg . org / image / 5dwltkxdp / http : / / postimg . org / image / die9y45yf /
It's not always the last 4 digits of their id :P |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 09:57 AM |
| I know, I've even seen a guest 0, but it is the last four digits, but with the insignificant zeroes removed. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 01:42 PM |
| Wait wouldn't it be "Guest " instead of "Guest 0"? |
|
|
| Report Abuse |
|
|
Hexabone
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 167 |
|
|
| 20 Jun 2015 01:46 PM |
| Checking if the UserId of the player is -1 is the most effective way to do this. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 01:48 PM |
Welp this has been a learning experience. I know I didn't ask the question but this is all really neat.
So the best way to check would be if player.userId > 0 then.
Neat :D! |
|
|
| Report Abuse |
|
|
| |
|