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: argument 1 missing or nil

Previous Thread :: Next Thread 
Voile is not online. Voile
Joined: 19 Dec 2011
Total Posts: 7598
06 Jan 2014 06:43 PM
in this bit of script

b.Plus.MouseButton1Down:connect(function()
local p = game.Players:findFirstChild(b.Name.Text)
p.leaderstats.bP.Value = p.leaderstats.bP.Value + 5
end)

im 90% sure the error is in this line:

local p = game.Players:findFirstChild(b.Name.Text)

________

b is a set of gui buttons, Name is the text bar in which i type the name of a player, and Plus is the button that gives him bPs (a leaderstat)

how to fix?
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
06 Jan 2014 06:45 PM
Make sure you type in the name with exact capitals, as if you don't it will error.
Report Abuse
Voile is not online. Voile
Joined: 19 Dec 2011
Total Posts: 7598
06 Jan 2014 06:55 PM
i do it without errors
Report Abuse
Voile is not online. Voile
Joined: 19 Dec 2011
Total Posts: 7598
06 Jan 2014 06:58 PM
i mean i dont misspell anything
Report Abuse
Voile is not online. Voile
Joined: 19 Dec 2011
Total Posts: 7598
06 Jan 2014 07:04 PM
bump
Report Abuse
Voile is not online. Voile
Joined: 19 Dec 2011
Total Posts: 7598
06 Jan 2014 07:15 PM
bump
Report Abuse
TutorialScripter is not online. TutorialScripter
Joined: 16 Nov 2013
Total Posts: 20
06 Jan 2014 07:25 PM

local p = game.Players:findFirstChild(b.Name.Text)



1 of two things are happening here. 1. you think that the Name property of a object has a text field aswell. Which it doesn't, or 2. You named something 'Name' and tried to get its property 'Text', but heres what the computer is thinking:

The computer is thinking you are indexing the property 'Name' of the Players Hierarchy. so when u say Name.Text it cant find a property of the Name Property, so therefor your argument is nil.


make the Name of the GUIObject named 'Name' to something else that's not a name of a property.
Report Abuse
Voile is not online. Voile
Joined: 19 Dec 2011
Total Posts: 7598
06 Jan 2014 07:32 PM
alright thanks dude
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