The script looks fine to me, if someone could please try to fix my issue as it will not spawn on click. If someone could also add an additional script to remove the object on click too, thanks.
local Object = game.ReplicatedStorage.Guy --Guy is my object in replicatedstorage
local ObjectSpawn = game.Workspace.ObjectSpawn --Object Spawner
function onClicked()
local CloneObject = Object:Clone()
CloneObject.Parent = game.Workspace
CloneObject:MoveTo(ObjectSpawn.Position)
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)

3 comments
I made a copy of your script and it worked fine
script.Parent.ClickDetector.MouseClick:Connect(function() local ObjectClone = game.ReplicatedStorage:FindFirstChild("Model"):Clone() ObjectClone.Parent = game.Workspace ObjectClone:MoveTo(game.Workspace.ObejectSpawner.Position + Vector3.new(0,2,0)) end)
I only answered here because the answer box didn't work