Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can I have help making a nuke?

Asked by
beastez 10
9 years ago

So I was trying to make a nuke and this is what I have so far but it does not work.

script.Parent = Nuke

function nuke()
Nuke.Size = Nuke.Size + Vector3.new(.5,.5,.5)
repeat until 
Nuke.Size = Vector3.new(100,100,100)
    end
end

script.Parent.Touched:connect(nuke)

1 answer

Log in to vote
1
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

When using repeat, the statement that you want to be executed each time has to be between the "repeat" and "until" keywords.

Here's an example from the wiki: http://wiki.roblox.com/index.php?title=Repeat#The_.27repeat.27_Statement

a = 0
repeat
    a = a + 0.1
until a == 1
print("a equals to 1!")

In your code, you are increasing the size outside of the repeat loop. So the repeat loop is basically doing nothing.

0
Ok I get it now, thanks beastez 10 — 9y
Ad

Answer this question