i = 0
script.Parent.Touched(function()
while i < 50 do
m = Instance.new("Hint", workspace)
m.Text = i
wait(1)
i = i + 1
end)
It error reads there is an unexpected symbol near ")" on line 9, but if I remove ) it breaks.
i = 0
script.Parent.Touched(function()
while i < 50 do
m = Instance.new("Hint", workspace)
m.Text = i
wait(1)
i = i + 1
end)
It error reads there is an unexpected symbol near ")" on line 9, but if I remove ) it breaks.
i = 0
script.Parent.Touched:connect(function()--Your forgot to "connect" the function
while i < 50 do
m = Instance.new("Hint", workspace)
m.Text = i
wait(1)
i = i + 1
end -- You need a second "end" for the while do loop
end)
A "while" loop is its own code block. Therefore, end is needed after line 8.
i = 0
script.Parent.Touched:connect(function()
while i < 50 do -- You could also do a "for" loop instead. It won't take up as much lines.
local m = Instance.new("Hint", workspace) -- You're going to end up making 50 messages.
m.Text = i
wait(1)
i = i + 1
end
end)
-- If you're curious about any of my comments, go ahead and tell me; I will happily explain it to you.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thank you. Forgot destory XD