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: 1 or More

Previous Thread :: Next Thread 
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
30 Apr 2014 03:04 PM
How would I say in a script for 1 or more? cos its so annoying when you have to say the exact numbers or whatsoever, so please answer, I need an 'if' "1 or a Bigger Number" statement...
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
30 Apr 2014 03:05 PM
a = 2
if a > 1 then
end
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
30 Apr 2014 03:05 PM
if THING >= 1 then
--code
end
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
30 Apr 2014 03:06 PM
Sorry you said 1 or more
if a >= then
end

Now its if a is more than or equal to 1 then
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
30 Apr 2014 03:26 PM
could that be a Value? like just instead of A type in the name of the value?
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
30 Apr 2014 03:28 PM
If its a number value.
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
30 Apr 2014 03:31 PM
oh, what will I do if its a string value?
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
30 Apr 2014 03:31 PM
A number is a (type of) value.
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
30 Apr 2014 03:31 PM
local THING = THING YOU WANT TO FIND

if THING.Value >= 1 then
--code
end
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
30 Apr 2014 03:32 PM
You can't really do that with string values...
Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
30 Apr 2014 03:32 PM
Assuming the string contains an integer, you can use 'tonumber(string)'
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
30 Apr 2014 03:32 PM
Use tonumber.

http://wiki.roblox.com/index.php?title=String#Converting_a_string_to_a_number
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
30 Apr 2014 03:58 PM
ok guys, so I changed back to Number Values... so I did as yas said... Time.Value >=1 so I hope it'll work... and btw, I have a 00:00:00 Format Clock thing inserted... so I want for every 60 seconds to add to 00:01:00 just like a real clock... so how would I do this with Number Value? cos I cant do 00:00:00 in the Number Value... so any suggestions?
Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
30 Apr 2014 04:01 PM
I would have three integers (lets call them h, m, and s) and I would just make a string when I want to use them

time = h..":"..m..":"..s
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
30 Apr 2014 04:01 PM
Where's the clock found??
Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
30 Apr 2014 04:02 PM
This is the script that I typically use to change the TimeOfDay, for reference

local tod = game:GetService("Lighting").TimeOfDay
local hour = string.sub(tod, 1, 2)
local minute = string.sub(tod, 4, 5)
local second = string.sub(tod, 7, 8)
local w = 0.01 -- Time it takes to pass one in-game second


while true do
second = second + 1
if second >= 60 then
second = 0
minute = minute + 1
if minute >= 60 then
minute = 0
hour = hour + 1
if hour >= 25 then
hour = 0
end
end
end
game:GetService("Lighting").TimeOfDay = hour..":"..minute..":"..second
--print(game:GetService("Lighting").TimeOfDay)
wait(w)
end
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
30 Apr 2014 04:08 PM
yeah but I want to do a function if the time is 0 and I wouldn't know how to do it if there are 3 Values... cos you'd have to say 'if that.Value == 970265, if hat.Value ==93207, if sdufhj.Value == 83947' so I dont know
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
30 Apr 2014 05:23 PM
Or guess what, your can just add seconds.
Report Abuse
BattleFieldPwner is not online. BattleFieldPwner
Joined: 05 May 2013
Total Posts: 233
30 Apr 2014 06:13 PM
if 60>then +1 minute


Add this to your script, I don't script clocks much but I can try to help :P







-What's wrong with my rainbow?-
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
01 May 2014 02:38 PM
but you mean like make an hour and minute TextLabel?
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
02 May 2014 12:12 PM
btw guys, I forgot to say, sry, I even inserted a SurfaceGui onto the thing, so it shows the Time...
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
06 May 2014 12:59 PM
so would I just make a TextLabel for Seconds and Minutes and Hours? and then do an "if Value == 00 and value == 00 and valu == 00 then" would that be better?
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
06 May 2014 01:07 PM
Divide your second counter by modulus 60 for minutes and do the same for the minute counter to get hours, if you like the hard way. If you want the easy way, use TimeOfDay.

local tictime = 0.5 -- 2:1 fast clock ratio
while wait(tictime) do
print(game.Lighting.TimeOfDay)
game.Lighting.TimeOfDay = game.Lighting.TimeOfDay + 1
end
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
06 May 2014 01:49 PM
lol I kinda got it already... am using, watever the guys name is... am using his script... but am confudsed... after I do the 'end end end'
I want the Minute.Value to show up in TimerGui.TimerFrame.Minutes.Text
I just said the Value = Text cos I already gave the directory to them earlier, so it looks like this... Minute.Value = Minutes.Text and
Second.Value = Seconds.Text plz help me guys! I dont know if its right! and it says (Unexepected symbol near '=')
Report Abuse
Kapitanovaskapandr is not online. Kapitanovaskapandr
Joined: 08 May 2013
Total Posts: 122
06 May 2014 02:52 PM
if Minute <== 0 and Second <== 0 then
am I doing this properly guys?
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