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: Attempting to find Player's name by Id?

Previous Thread :: Next Thread 
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
27 Nov 2012 06:46 PM
How would I find the Player's name with their id?
Report Abuse
thecaptain97 is online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
27 Nov 2012 06:52 PM
id = 0000

function findPlyr()
p=game.Players:GetChildren()
for i =1,#p do
if p[i].userId==id then
return p[i]
end
end
return false
end


Player = findPlyr()
print(Player.Name)
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
27 Nov 2012 06:52 PM
I don't think that a person's Id connects to their name, or that there is any method for doing so.
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
27 Nov 2012 06:53 PM
You mean in-game?
Report Abuse
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
27 Nov 2012 06:54 PM
Well, yes that would work. But I'm trying to locate the creators name through Id. :I

local m = Instance.new("Message", Workspace)
m.Text = "Owner is "..game.CreatorId

How would I change that to it's name. :I
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
27 Nov 2012 07:00 PM
if player.userId == 34810416 then
print 'blueboy here bro'
end


- thedestroyer115
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
27 Nov 2012 07:00 PM
Oh, nevermind. Interesting question.

- thedestroyer115
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
27 Nov 2012 07:02 PM
The method for something like GetPlayerFromId is locked :l
Report Abuse
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
27 Nov 2012 07:03 PM
Well, yes. That would work. But, I am not trying to use a PlayerAdded function. I am making a free model and I want credit. So, I am making a hint saying "owner thanks blueboy167thst for his model".

Is this possible?
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
27 Nov 2012 07:05 PM
Well you'd have to find the CREATOR's ID, not just any random one...
Report Abuse
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
27 Nov 2012 07:05 PM
I know that. This does that:

game.CreatorId


:I
Report Abuse
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
27 Nov 2012 07:21 PM
function IfMyGame(id)
if game.CreatorId == id then
return true
else return false
end
end

if IfMyGame(idhere) then
return
else local m = Instance.new("Message")
m.Text = "Text here"

something like that?

nyan nyan nyan
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
27 Nov 2012 07:22 PM
He wants to be able to have an Id of a player, and find that players name.

- thedestroyer115
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
27 Nov 2012 07:23 PM
dood u JUST DID SOME THING USELES!!!! AERGeadfhzsafdrtd

dats liek umg dats liek an if statement compleximized dood.

if game.CreatorId == id then --U IDOT U GET DA DAMN BOOL HERE!!!!!!!!!


QWER24WYHTGFAQGFNRTGF5DCJKVNFJGHGDDSFHD
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
27 Nov 2012 07:25 PM
No one understand you blueboy. Lol'd.

- thedestroyer115
Report Abuse
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
27 Nov 2012 07:29 PM
:I
I don't find it hard to understand. I want to know how to find a player's name using their Id.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
27 Nov 2012 07:35 PM
function findID(id)
for _,player in pairs(game.Players:GetPlayers()) do
if player.userId == tonumber(id) then
return player.Name
end
end
end

print(findID(game.CreatorId))
Report Abuse
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
27 Nov 2012 07:35 PM
But what if the player is not in game?
Report Abuse
Wowgnomes is online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
27 Nov 2012 07:39 PM
than it should still work
just use tostring
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
27 Nov 2012 07:40 PM
lolno stupid.

trool > little ugly peice of gnofme [ Content Deleted ]
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
27 Nov 2012 07:40 PM
^ Get out troll.

- thedestroyer115
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
27 Nov 2012 07:41 PM
u
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
27 Nov 2012 07:42 PM
just do this:

H = Instance.new("Hint", Workspace)
H.text = This model was created by: blueboy167thst

(Been away from Lua for awhile but this might work.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
27 Nov 2012 07:43 PM
might ~= does

dat code failed asdly :l
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
27 Nov 2012 07:44 PM
@Chop
I was talking to wowgnomes.

- thedestroyer115
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