I haven’t done lua in a while but decided to stretch my lua legs a little with a script using the clone function, which I’ve never actually used before.
It’s supposed to spawn a plane, and then remove said plane after three seconds. The thing is, it only works once and never again.
The script is below. Any ideas as to why it won’t repeat?
Thanks.
planeold = game.ServerStorage.Model
planenew = planeold:clone()
function onClicked()
planenew.Parent = game.Workspace
wait(3)
planenew:Remove()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)