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: Simple 7-line script won't work.

Previous Thread :: Next Thread 
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:00 AM
for i = 1, 1, 9999999999999999999999999999999999999 do
wait(0.5)
a = game.Workspace.Debt:findFirstChild("Model")
wait(0.25)
a.Name = "America's Debt: "..i + 15831557202619
end

Workspace.Script:6: attempt to index global 'a' (a nil value)
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
04 Jul 2012 01:04 AM
while true do
wait(0.5)
a = game.Workspace.Debt:findFirstChild("Model")
wait(0.25)
a.Name = "America's Debt: "..i + 15831557202619
end
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
04 Jul 2012 01:04 AM
nvm, this is kinda racist.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:05 AM
You didn't define a, and the above won't work aswell.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
04 Jul 2012 01:05 AM
for i = 1, math.huge do
wait(0.5)
a = game.Workspace.Debt:FindFirstChild("Model")
wait(0.25)
a.Name = "America's Debt: "..i + 15831557202619
end

Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:06 AM
Sry forget what I wrote. But the above is still wrong.

Floodcheck.
Report Abuse
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:06 AM
It must be a for loop. i is the iteration plus America's debt.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
04 Jul 2012 01:06 AM
I'm sorry, I'm so hilarious right now XP
Report Abuse
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:07 AM
miz thanks for the hint with math.huge to compact the first line, but it still errors with the same original error.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:08 AM
Maybe there's nothing named as "Model" in your workspace?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:09 AM
for i = 1, math.huge do
wait(0.5)
a = game.Workspace.Debt:FindFirstChild("Model")
wait(0.25)
a.Name = "America's Debt: "..(i + 15831557202619).. "" --Else try this.
end
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
04 Jul 2012 01:09 AM
for i = 1, math.huge do
wait(0.5)
local a = game.Workspace.Debt:FindFirstChild("Model")
wait(0.25)
a.Name = "America's Debt: "..i + 15831557202619
end

Are you sure you got your location right?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
04 Jul 2012 01:11 AM
If cheaters script doesn't work try this.

for i = 1, math.huge do
local number = i + 15831557202619
wait(0.5)
local a = game.Workspace.Debt:FindFirstChild("Model")
wait(0.25)
a.Name = "America's Debt: "..tonumber(number)--If this doesn't work try just saying number.
end

Report Abuse
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:12 AM
I don't know how to use FindFirstChild. This is a text brick with a Humanoid. Debt is the model with a model inside it which is the name of the Humanoid which is being changed every 0.75 seconds.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:14 AM
There aren't several "Debt"'s in workspace right?
Report Abuse
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:14 AM
No.
Report Abuse
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:25 AM
Help?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:32 AM
Oh I think we're all stupid, aren't we?

Logically the name of the Model will change after the first time, so it won't be able to find that model again.

You could (for example) insert a Numbervalue and change that value instead. Change the name of the value to "NumberValue" if it isn't already. Insert it into "Model". Now add this script inside "Model":



for i = 1, math.huge do
wait(0.5)
a = script.Parent.NumberValue
wait(0.25)
a.Value = (i + 15831557202619)
end

while true do
wait()
script.Parent.Name = "America's Debt: " ..script.Parent.NumberValue.Value.. ""
end
Report Abuse
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:37 AM
It appears to be working with no errors, but I think it won't get to the while loop at the bottom which changes the name until the for loop at the top ends, which will be never.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:39 AM
If that should really be like that, just insert the while loop stuff in another script.
Report Abuse
NoobsTookMyUsername is not online. NoobsTookMyUsername
Joined: 02 Nov 2008
Total Posts: 52
04 Jul 2012 01:39 AM
Nevermind, I did it myself:

for i = 1, math.huge do
wait(0.5)
a = script.Parent.NumberValue
wait(0.25)
a.Value = (i + 15831557202619)
script.Parent.Name = "America's Debt: " ..script.Parent.NumberValue.Value.. ""
end
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:39 AM
Ya, actually right. I made an unnecessary 2nd loop.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
04 Jul 2012 01:39 AM
Ya, actually right. I made an unnecessary 2nd loop.

FRAKING FLOODCHECK!
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