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 » Scripters
Home Search
 

Re: Not working...

Previous Thread :: Next Thread 
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
08 Aug 2016 01:23 AM
tool.Equipped:connect(function(mouse)--put this in to state I have stuff before it
end)


while canfire == true and fun > 0 and nofun > 0 do --this isnt working...
wait(0.01)
if fun > 0 then
fun = fun - 0.001
end
if nofun > 0 then
nofun = nofun - 0.001
end
print('Changed '..nofun..', '..fun)
end
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
08 Aug 2016 01:26 AM
By 'not working,' what do you mean? What is it doing, and what do you want it to do?

Off the top of my head, I can say that your two if statements are redundant (the fact the loop is still running means that fun > 0 and nofun > 0). Did you, perhaps, mean something like this?

while true do
wait(0.01)
if canfire == true then
if fun > 0 then
fun = fun - 0.001
end
if nofun > 0 then
nofun = nofun - 0.001
end
print('Changed '..nofun..', '..fun)
end
end
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
08 Aug 2016 01:26 AM
No its not running at all.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
08 Aug 2016 01:28 AM
Is canfire false?
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
08 Aug 2016 01:29 AM
No its true.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
08 Aug 2016 01:30 AM
print(fun,nofun) in each loop and before the loop.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
08 Aug 2016 01:32 AM
Is the script running at all?

Add a simple, unconditional print to the top of the script. Is it being printed?
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
08 Aug 2016 01:34 AM
Trust me everything else works, and it's too long to post here. Only the while loop doesn't work at all.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
08 Aug 2016 01:34 AM
like I said before, print it before and check all your values all the time to see what is wrong
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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