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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re:

Previous Thread :: Next Thread 
Phidias is not online. Phidias
Joined: 06 Nov 2009
Total Posts: 765
05 Feb 2015 12:12 AM
I'm having an issue with game.Players:FindFirstChild(player) returning nil when passed player from the ClickDetector.MouseClick event. What could be causing this?
Report Abuse
Seranok is online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
05 Feb 2015 12:14 AM
The player argument of ClickDetector.MouseClick is already a player, so there's no need to do anything extra to get a player object.
Report Abuse
pa00 is not online. pa00
Joined: 06 Jun 2010
Total Posts: 451
05 Feb 2015 12:17 AM
I'm pretty sure that FindFirstChild only takes a string as an argument. If you're passing a player object to it, that's not the correct type and also redundant.
Report Abuse
Phidias is not online. Phidias
Joined: 06 Nov 2009
Total Posts: 765
05 Feb 2015 12:19 AM
I'm needing to access the scoreboard value in the game.Players.playerName though

local p = game.Players:FindFirstChild(player)

if p then
p.leaderstats.Pocket.Value = p.leaderstats.Pocket.Value + 2



Also note im passing it over remoteEvent and handing the scoreboard stuffs in a server script
Report Abuse
Phidias is not online. Phidias
Joined: 06 Nov 2009
Total Posts: 765
05 Feb 2015 12:21 AM
Oh, well I also tried with player.Name and got nil so :(
Report Abuse
twister1976 is not online. twister1976
Joined: 17 Sep 2010
Total Posts: 2250
05 Feb 2015 12:21 AM
I don't think you need to check if the player is there is it is already there?

If money grew on trees... It would be as valuable as leaves. | Twitter: @TwisterRBLX
Report Abuse
pa00 is not online. pa00
Joined: 06 Jun 2010
Total Posts: 451
05 Feb 2015 12:21 AM
If you absolutely want to write the code like that, just replace player with player.Name in the FindFirstChild argument. But again, it's completely redundant. You could even say

p = player
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
05 Feb 2015 12:22 AM
Do player.Name if you really want to
Report Abuse
Phidias is not online. Phidias
Joined: 06 Nov 2009
Total Posts: 765
05 Feb 2015 12:25 AM
I feel like an idiot for not realising it was the same player as the players in game.Player and not the player from workspace
Report Abuse
Phidias is not online. Phidias
Joined: 06 Nov 2009
Total Posts: 765
05 Feb 2015 12:26 AM
It works now, thanks :p
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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