 0  # How can i tell to a script to run a script 6 times in a row? Gigaset39 87
15 days ago
Edited 15 days ago

how i can tell to a script to run 6 times in a row? like:

       local Dice = math.random(1,3)
hint.Value = '3'
wait(0.9)
hint.Value = '2'
wait(0.9)
hint.Value = '1'
wait(0.9)

if Dice == 1 then
P.CanCollide = false
end

if Dice == 2 then
P.CanCollide = false
end

if Dice == 3 then
P.CanCollide = false
end

until 6x  --- :D :D :D


You got what i mean? i could copy & paste that, but i don't want to do that, cause it has 12 if Dice ==, so is gona be hard . :D :D

2   SuperPuiu 482 15 days ago

Hello!

I didn't understood much, but from what I think you want the code to repeat 6 times right? Well, there are multiple ways to do that. First: for loop:

for i = 1, 6 then

local Dice = math.random(1,3)
hint.Value = '3'
hint.Value = '2'
hint.Value = '1'

if Dice == 1 then
P.CanCollide = false
end

if Dice == 2 then
P.CanCollide = false
end

if Dice == 3 then
P.CanCollide = false
end

end


Or a repeat loop:

-- Only an example
local numberOfRuns = 0

-- Do something here

numberOfRuns += 1
until numberOfRuns >= 5



Anyways, this is based on what I understood. 0
Mersi SuperPuiu, r?mân dator cu un suc. :D Gigaset39 87 — 15d 0
Cu placere! SuperPuiu 482 — 14d 