I don’t really understand what you’re talking about? But this is basically exactly what I am talking about.
Let’s say you have 2 positions, “699.21, 30.062, -5415.25”, and then “684.67, 30.062, -5435.845” How could I make it supposed to spawn within those 2 positions? Is there also a way to make there have a max amount of Coins so it doesn’t get laggy, and let’s say you get it 5 max, and it hits those 5 coins, if you collect a coin it will respawn, but since it’s at max it will NOT Respawn till another coin is collected. How can I do that?
Can you explain how I can edit it and get what I want? I don’t really see what to do… for the Spawn1, etc, what do I put, and make it that? A part, a Folder?
local spawncframes = {CFrame.new(699.21, 30.062, -5415.25), CFrame.new(684.67, 30.062, -5435.845)}
local rand = math.random(1, #spawncframes)
local coin = game.ServerStorage:WaitForChild("Coin")
while task.wait(10) do
local coinclone = coin:Clone()
coinclone.CFrame = spawncframes[rand]
coinclone.Parent = workspace
end
That right there is a module called ZonePlus made by the one and only ForeverHD. What you would be doing is creating a folder for your zone, putting specific boundings for where you want your coins to spawn in the folder and then using the :getRandomPoint() function to get a random vector in your zone.
Yeah, that’s happening because there are only 2 possible spawn locations and you set the coins to spawn every second. Other than that the script works.
local spawncframes = {CFrame.new(699.21, 30.062, -5415.25), CFrame.new(684.67, 30.062, -5435.845)}
local rand = math.random(1, #spawncframes)
local coin = game.ServerStorage:WaitForChild("Coin")
while task.wait(10) do
local coinclone = coin:Clone()
local random = math.random(-5, 5)
coinclone.CFrame = spawncframes[rand]
coinclone.Position += Vector3.new(random, random, random)
coinclone.Parent = workspace
end
You would used .Touched (make sure to destroy the connection afterwards of course) to detect when the coin has been touched. From there you would program it to add a number to a leaderstat and so on. There are tutorials for this on youtube by the way.