Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:05 PM |
I've been getting the stupidest errors lately its ridiculous. I just got this error...
"attempt to index field 'Parent' (a nil value)"
Like what... Obviously everything has a parent(except game; which I am not indexing). I just don't get it. I've been getting all sorts of errors from this single line. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 18 Aug 2014 06:10 PM |
| some things don't have parents. Like CFrame and UDim2. |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:11 PM |
The line has nothing wrong in it, it's super simple and has worked dozens of times for me. There is something wrong with the variable I am trying to index in the line.
I can't figure out what's wrong with the variable(s).
The script works if I write out the variable but I don't want to have to do that every time I index it in the script, but if I try to use the variable it errors...
timertext = timer.SurfaceGui.Frame1.Frame2.Text1 timertime = timer.SurfaceGui.Frame1.Frame2.Time
Both those variables error when I try to index them(they are variables for textlabels) |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:12 PM |
"attempt to index global 'timertime' (a number value)"
same error occurs with timertext both local and globally |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 06:13 PM |
| idk wut to do but whenever i have some problem like dat I just put local in front of it. me not know difference. derp. |
|
|
| Report Abuse |
|
|
| |
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:15 PM |
its a part.
timer = game.Workspace:WaitForChild("RoundClock") |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 06:20 PM |
| print timerwhatever where the error occurs. And the whole script would be useful. |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:21 PM |
| Whole script is 59 lines long. If you want it I can post it, unless you just want an excerpt from it. The error occurs anywhere in the script where I index either variable |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 06:23 PM |
| Stick it on pastebin and paste the paste ID (from the URL). I don't think you're allowed to post the whole URL. |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:24 PM |
| I printed both variables and the output was the two textlabel's names. The hierarchy is correct |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:26 PM |
pastebin.com/s6DcMiQa
if that is censored just put in /s6DcMiQa after pastebin |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:26 PM |
| i changed timertext and timertime to clocktext and clocktime, to see if that did anything... but no |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 06:40 PM |
clocktime = (tonumber(i))
You just set clocktime to be a number...
-__- |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:47 PM |
| I know, it counts down from 30 and it works, the error happens after the timer finishes |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 06:48 PM |
| Don't you see? You've changed clocktime from an object to a number, which causes the error you talk of. |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:48 PM |
I found an alternative to make the script run but its super annoying.
every time i want to use the variable for timertext or timertime i have to write out the whole hierarchy... works but is very annoying |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:49 PM |
| No, it changes the Text of the textlabel, not the actual textlabel |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:51 PM |
| Oh, i see where you got that from, thats on line 60 but the script doesnt even get that far before it errors and breaks so i already fixed that |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 06:52 PM |
As a proof of problem (wat), can you remove this?
for i = 60, 1, -1 do clocktext = "Game in progress, ending in: " clocktime = (tonumber(i)) end |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 18 Aug 2014 06:56 PM |
| thats not where it errors, it errors at the first for 'i' loop where it counts for 30 seconds, the game didnt even get to that part of the script before it crashed because of the error |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2014 07:04 PM |
I made a demo of the thing you're running this in and I don't get any errors with
for i = 60, 1, -1 do clocktext.Text = "Game in progress, ending in: " clocktime.Text = (tonumber(i)) end
You might also want to put a wait in there. |
|
|
| Report Abuse |
|
|