Button only working once?

So i made this script and to spawn noobs but it only spawns once here is the code any help is thankful thanks!

local clone = game.ReplicatedStorage.Noob

script.Parent.MouseButton1Click:Connect(function()
	clone.Parent = workspace
end)

2 Likes

You must clone it in the MouseButtton1Click:

script.Parent.MouseButton1Click:Connect(function()
    local clone = game.ReplicatedStorage.Noob:Clone()
	clone.Parent = workspace
end)
2 Likes

You didn’t Clone() the Noob variable after you clicked the button :sweat_smile: Also, make sure to use MakeJoints() if your Noob is a Model so that all it’s parts are welded correctly

1 Like

That was a quick fix thanks! im such a beginner thats why.

3 Likes

You can do this as well
``script.Parent.MouseButton1Click:Connect(function()
while true do

local clone = game.ReplicatedStorage.Noob:Clone()
clone.Parent = workspace
wait()
end)``

wouldnt that just loop it from 1 click tho?

1 Like

while true do will run forever return until won’t. It loop that why added in script thought if player click ones it loop forever.