Part spawning script not working

I’m trying to make a script to where once you click this new instance, it’ll then be destroyed and summon another in its place. However, it seems to not be working, and it’d be great if one of you would be able to help me with it. here’s the script:

pretty new to scripting, so tips would also be great. Thanks for reading! :smiley:

(I’m sorry for not specifying what the script was supposed to do, I’ll send a video later on the error included with the fix.)

std

type this into script

script.Parent.Anchored = false

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	script.Parent.Position = Vector3.new(math.random(1,20),50,script.Parent.Position.Z)
end)
1 Like

That actually helps great with my positioning problem I had, but that still doesn’t solve the main issue that I’m having with the spherepoints instance not being added back into the workspace once one has been clicked on. I’m sorry that I didn’t specify about the instance being destroyed and being summoned again instead of the parent.

Regardless, this has helped me a lot with the script, thanks!

maybe this will help and you can add color changing script into this

1 Like

Thanks, I’ll try it right now!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.