generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Defining a player in a NORMAL script.

Previous Thread :: Next Thread 
KEVEKEV77 is not online. 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 is not online. 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 is not online. 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 is not online. Sameasth
Joined: 02 Nov 2013
Total Posts: 1950
14 Nov 2013 06:23 PM
player = game.Players.PLAYERUSERNAME
Report Abuse
KEVEKEV77 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Isometricity is not online. Isometricity
Joined: 26 Oct 2011
Total Posts: 438
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image