|
| 09 Nov 2013 09:41 PM |
whenever I tr to use while true do, I get crashes.
repeat seems to need to have an end
anything that I can use? |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2013 09:44 PM |
use: while true do wait() end
or:
repeat --stuff until 1<2 |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2013 10:06 PM |
while wait(1/30) do end --prevents any crashing
repeat wait(1/30) --code until condition
function x() wait(1/30) --code x() end
idk |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2013 10:54 PM |
| When using infinite loops, you must use a wait() to pause the script. |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2013 11:08 PM |
You can always use two scripts and two value make one play if the value if active vice versa ( use onchanged function )( Also best value to use would be a bool value)
function OC1() if script.Parent.S1.ON.Value == true then script.Parent.S1.ON.Value = false --Run a script... >_< wait(0.25)-- Idk you may need a wait >_< end
function OC2() if script.Parent.S2.ON.Value == true then script.Parent.S2.ON.Value = false --Run a script... >_< wait(0.25)-- Idk you may need a wait >_< end
onchanged blah blah(S1) onchanged blah blah(S2)
Just a rough example... :P
|
|
|
| Report Abuse |
|
|
|
| 09 Nov 2013 11:10 PM |
--Wow forgot to put after wait.. >_<
function OC1() if script.Parent.S1.ON.Value == true then script.Parent.S1.ON.Value = false --Run a script... >_< wait(0.25)-- Idk you may need a wait >_< script.Parent.S2.ON.Value = true end
function OC2() if script.Parent.S2.ON.Value == true then script.Parent.S2.ON.Value = false --Run a script... >_< wait(0.25)-- Idk you may need a wait >_< script.Parent.S1.ON.Value = true end
onchanged blah blah(S1) onchanged blah blah(S2) --fixed sorry about that >_< |
|
|
| Report Abuse |
|
|