|
| 11 Nov 2013 09:00 PM |
How can you find a players name? And then change say the scripts name to the players name. So like this:(JUST AN EXAMPLE OF WHAT I WANT)
PlayersName = GetPlayername script.Name = PlayersName
-//=auréolefeu902 |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Nov 2013 09:03 PM |
But how.. Like GetPlayerName()?
-//=auréolefeu902 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 11 Nov 2013 09:03 PM |
depends, Local or normal script if it's local den you use
game.LocalPlayer
I fnormal you use playeradded or a loop. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Nov 2013 09:04 PM |
| game.Players.LocalPlayer.Name* |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Nov 2013 09:31 PM |
Wait what about regular script?
-//=auréolefeu902 |
|
|
| Report Abuse |
|
|
Ekkoh
|
  |
| Joined: 22 Oct 2012 |
| Total Posts: 524 |
|
|
| 11 Nov 2013 09:35 PM |
script.Name = Game.Players["halofire902"].Name > halofire902
"To sing when you live and to sing when you die" - George Ragan |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2013 09:41 PM |
"script.Name = Game.Players["halofire902"].Name"
If you're offering help don't make it unnecessarily complicated.
script.Name = game.Players.halofire902.Name
People are here to learn, not to be impressed by how much knowledge you have. Seriously why does this even need to be said. |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2013 09:42 PM |
I mean the local player without being in a local script
-//=auréolefeu902 |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2013 09:44 PM |
| If you aren't using a LocalScript, your script is running in the server. There is no local player in the server, so you'll need to specify what you mean by "local player" if you want me to tell you how to get it from a Script. |
|
|
| Report Abuse |
|
|
Ekkoh
|
  |
| Joined: 22 Oct 2012 |
| Total Posts: 524 |
|
|
| 11 Nov 2013 09:49 PM |
Calm it down Arc. I chose to do it that way because it was more clear where the name of the player came from. I've been around these forums for a good while now, I wouldn't be here if I was attempting to confuse people, I'm trying to help. Nor was I trying to act smart. It's funny actually, there's a lot of people like you on here that get some satisfaction out of sporadically attacking someone, and all I did was post a line of code.
"To sing when you live and to sing when you die" - George Ragan |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2013 09:53 PM |
Okay, I want a script that I'm going to put in StarterGui, and I want it to find the players name..
Like say ounce it's in PlayerGui It would get the name of the parent of the character. But Some how when I did this it did not work so asked you guys |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2013 10:48 PM |
" there's a lot of people like you on here that get some satisfaction out of sporadically attacking someone, and all I did was post a line of code. "
I'm not sporadically attacking you, I'm expressing my discontent about people who come here and put new scripters on the wrong track. You /should/ know that almost every beginner uses the dot operator for indexing values in tables, so I have no patience for people using brackets to reference things when it's blatantly easier to just type ".". I'm here to be a nice guy and to help people learn, but you want to post confusing code for no reason you'll find yourself on my bad side very quickly.
----------- "Okay, I want a script that I'm going to put in StarterGui, and I want it to find the players name.."
If you want to put it in the StarterGui, you should be using a LocalScript. In a localscript, if you want to local player's name, you should use
script.Name = game.Players.LocalPlayer.Name |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2013 02:02 PM |
That's exactly what I wanted Thanks |
|
|
| Report Abuse |
|
|
Ekkoh
|
  |
| Joined: 22 Oct 2012 |
| Total Posts: 524 |
|
|
| 12 Nov 2013 04:45 PM |
"Confusing code" is subjective to whoever wrote it. And if you honestly think using brackets and quotes to index a value is that much more complicated than using the dot operator, then that's your opinion. I will say though, I was in no way trying to confuse the OP. I'm here to help him just as you are.
"To sing when you live and to sing when you die" - George Ragan |
|
|
| Report Abuse |
|
|