KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 14 Nov 2013 06:19 PM |
ok.... How would I define it different from this, cause this only works in localscript
player = game.players.LocalPlayer
any other ways |
|
|
| Report Abuse |
|
|
Sameasth
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1950 |
|
|
| 14 Nov 2013 06:21 PM |
player = script.Parent.Parent.Parent.etc... if the script will be a child of the player
player = game.Players:GetChildren() for i = 1, #player do if player[i].Name = "NAME" then yourplayer = player[i] end end
idk |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 14 Nov 2013 06:22 PM |
| I just wanted that one line, not a script, someoneelse please help |
|
|
| Report Abuse |
|
|
Sameasth
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1950 |
|
|
| 14 Nov 2013 06:23 PM |
| player = game.Players.PLAYERUSERNAME |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 14 Nov 2013 06:26 PM |
Nooo I don't want that. I just want the general player, whoever entered like this, except in normal script definition
player = game.players.LocalPlayer -- see? No PlayersName |
|
|
| Report Abuse |
|
|
Sameasth
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1950 |
|
|
| 14 Nov 2013 06:30 PM |
game.Players.PlayerAdded(function(player) print(player.Name) end) |
|
|
| Report Abuse |
|
|
Sameasth
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1950 |
|
|
| 14 Nov 2013 06:31 PM |
what's wrong with me today?
game.Players.PlayerAdded:connect(function(player) print(player.Name) end) |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 14 Nov 2013 07:28 PM |
thanks. This applys something to when a player comes. I think....
But I want it to get teh localplayer, I guess I would use a localscript for tat. |
|
|
| Report Abuse |
|
|
|
| 14 Nov 2013 07:44 PM |
| In a regular script, there's no such thing as a localplayer. If the script is a descendant of the player (tool, GUI) then you could use script.Parent.Parent... until you hit the player. Other than that, you would have to be using a function like onPlayerEntered() with the player defined. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Nov 2013 08:41 PM |
Or if it's a script in a part GetPlayerFromCharacter
Or if it's in a hopperbin script.Parent.Parent.Parent
Or if it's in a tool GetPlayerFromCharacter tool.Parent |
|
|
| Report Abuse |
|
|