local spawnArea = game.Workspace.SpawnArea
local coin = game.ReplicatedStorage:WaitForChild("Coin")
local areaSize = spawnArea.Size
local function randomPosition()
local areaX = math.random(areaSize.X)
local areaY = spawnArea.Size
local areaZ = math.random(areaSize.Z)
Vector3(areaX, areaY, areaZ)
end
local function spawnCoin()
local spawnPosition = randomPosition
local coin = coin:Clone()
coin.Position = spawnPosition()
coin.Parent = workspace
end
while true do
spawnCoin()
wait(0.5)
end ``` guys help
#started to make code myself after going through like 40 tutorial videos (It not go well)
1 messages · Page 1 of 1 (latest)
whats wrong with it
it not working for some :C
local function spawnCoin()
local spawnPosition = randomPosition
local coin = coin:Clone()
coin.Position = spawnPosition()
coin.Parent = workspace
end
should be
local function spawnCoin()
local spawnPosition = randomPosition()
local coin = coin:Clone()
coin.Position = spawnPosition
coin.Parent = workspace
end
you put the parenthesis in the wrong spot
** You are now Level 11! **
They dont even spawn on the spawn area
and they stop after like 5 coins]
man
💀
instead of getting the size of the spawn area you should be getting the position of the spawn area modified by its size