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: Can u not use functions in loops?

Previous Thread :: Next Thread 
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
29 May 2015 09:03 PM
timer.Value = 45
for i = 45, 0, -1 do
wait(1)
timer.Value = timer.Value - 1
status.Value = timer.Value
checkplayers()
if playersdead then break end
if won.Value then break end
end -- i = end thing





status freezes at 44
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
29 May 2015 09:04 PM
you can you are obv not doing something right.
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
29 May 2015 09:05 PM
am i? heres the function its activating

function checkplayers()
for _,v in pairs(game.Players:GetPlayers()) do
if v.Tag then
playersdead = false
else
playersdead = true
end
end
end
end
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
29 May 2015 09:07 PM
ok so its working but


it won't break the end?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
29 May 2015 09:12 PM
Okay okay I found the problem


In the main script, if the tag doesn't exist instead of making the value true or false it just says:
- Tag is not a valid member of Player

What??

function checkplayers()
for _,v in pairs(game.Players:GetPlayers()) do
if v.Tag then
playersdead = false
else
playersdead = true
end
end
end
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
29 May 2015 09:15 PM
for i = 45, 0, -1 do
timer.Value = i
status.Value = i
checkplayers()
if playersdead then
break
end
if won.Value then --if won.Value == ?
break
end
wait(1)
end
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
29 May 2015 09:19 PM
thats not the problem
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
29 May 2015 09:38 PM
repeat wait() until v.Tag ~= nil
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