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: I seriously don't understand Roblox sometimes.

Previous Thread :: Next Thread 
Vyxium is not online. 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
EternaIGod is not online. EternaIGod
Joined: 01 Apr 2011
Total Posts: 23592
18 Aug 2014 06:05 PM
lol.

care.exe has stopped
Report Abuse
Augmentative is not online. Augmentative
Joined: 08 Jul 2014
Total Posts: 593
18 Aug 2014 06:05 PM
Can we see the script?
Report Abuse
vortexyamum is not online. vortexyamum
Joined: 31 Aug 2011
Total Posts: 1979
18 Aug 2014 06:10 PM
some things don't have parents. Like CFrame and UDim2.
Report Abuse
Vyxium is not online. 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 is not online. 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
vortexyamum is not online. vortexyamum
Joined: 31 Aug 2011
Total Posts: 1979
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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
18 Aug 2014 06:13 PM
print what timer is.
Report Abuse
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
18 Aug 2014 06:15 PM
its a part.

timer = game.Workspace:WaitForChild("RoundClock")
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
18 Aug 2014 06:20 PM
print timerwhatever where the error occurs. And the whole script would be useful.
Report Abuse
Vyxium is not online. 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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
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 is not online. 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 is not online. 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 is not online. 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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
18 Aug 2014 06:40 PM
clocktime = (tonumber(i))

You just set clocktime to be a number...

-__-
Report Abuse
Vyxium is not online. 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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
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 is not online. 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 is not online. 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 is not online. 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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
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 is not online. 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
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
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
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