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
|
  |
| 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
|
  |
| Joined: 19 Dec 2011 |
| Total Posts: 7598 |
|
| |
|
Voile
|
  |
| Joined: 19 Dec 2011 |
| Total Posts: 7598 |
|
|
| 06 Jan 2014 06:58 PM |
| i mean i dont misspell anything |
|
|
| Report Abuse |
|
|
Voile
|
  |
| Joined: 19 Dec 2011 |
| Total Posts: 7598 |
|
| |
|
Voile
|
  |
| Joined: 19 Dec 2011 |
| Total Posts: 7598 |
|
| |
|
|
| 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
|
  |
| Joined: 19 Dec 2011 |
| Total Posts: 7598 |
|
| |
|