Why is my script not working?

Im trying to make a generator but, my script is not working.

local ServerStorage = game:GetService("ServerStorage")

local TixStone = ServerStorage:WaitForChild("TixStone")

while true do
	task.wait(1)
	
	local TixStoneClone = TixStone:Clone()
	TixStoneClone.Parent = game.Workspace
	TixStoneClone.Name = "TixStone"
	TixStoneClone.Position = Vector3.new(-171.608, -77.013, 149.663) or Vector3.new(-163.608, -81.013, 164.663) or Vector3.new(-129.608, -91.013, 160.663) or Vector3.new(-138.608, -81.013, 135.663) or Vector3.new(-109.608, -92.013, 135.663) or Vector3.new(-125.608, -92.013, 154.663)
	
	task.wait(45)
	
	TixStoneClone:Destroy()
end

What isn’t working Screen Shot 2021-11-21 at 6.25.46 PM

2 Likes

Whats the point of having two waits in there?

sorry if I did not specify that, It wont spawn the part at all. I think this is because line 11 Which sets the blocks position. Its supposed to be randomly generated.

instead of that, use that math.random function for random positions

1 Like

Its so in a specified amount of time, the clone will destroy if the player(s) don’t get it due to no one going inside of the mines.

I mean like, I don’t want the game to have thousands of generated blocks that will lag/crash the game lol.

Instead use a table and pick randomly here is a bit of code

local Positions = {positions here}

TixStoneClone.Position = Positions[math.random(1,#Positions)]

Just made it up on the spot tho so might not work

1 Like

Do you want this 45-second wait to yield the loop that creates new tix stones?