|
| 15 May 2015 08:07 PM |
I am just getting started and practicing loops. Why won't this work?
function onTouched(hit) while true do wait(1) msg = Instance.new("Message") msg.Parent = game.Workplace msg.Text = "Now we are moving along Jacob" wait(3) msg:Destroy() end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 May 2015 08:34 AM |
it should work but here i made it better
script.Parent.Touched:connect(function() -- se how i did that on one line? for i = 1,math.huge do -- another way of looping local msg = Instance.new("Message",workspace) -- parent it too while making it. Also its workspace not workplace. msg.Text = " " == add your text wait(3) -- wait 3 seconds msg:Destroy() -- Destroy it end -- connect the loop end) -- an ) for doing it on 1 line |
|
|
| Report Abuse |
|
|
|
| 16 May 2015 08:37 AM |
| Thanks! I think the only problem is it is Workspace not workplace |
|
|
| Report Abuse |
|
|