I know that there is a video tutorial on ROBLOX Wiki, but it will not fix this script. It is for an odd mining game that I am making, so that a dinosaur skull will spawn in random places, but it does not work. The skull blocks do not even appear. I know that this will probably be an easy fix for experienced scripters, so please take a few seconds and help me. Here is the game so far: https://www.roblox.com/games/544182596/No-name-yet-Open-during-construction
Here is the script:
local skull = script.Parent:Clone()
local xpos = math.random(-10,10)
local zpos = math.random(-10,10)
function skullspawn()
skull.Parent = game.Workspace
skull.Script:Destroy()
skull.Position = Vector3.new(xpos, 0.02, zpos)
end
while true do
skullspawn()
wait(0.1)
end

3 comments
Thank you! I thought it was because they could collide and it was forcing strain on the system. But now that I think about it, your solution makes sense.
I thought your script didn't work, but they were spawning inside the baseplate because I forgot to lower it... XD
Haha glad to help