#started to make code myself after going through like 40 tutorial videos (It not go well)

1 messages · Page 1 of 1 (latest)

civic ridge
#
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
tough magnet
#

whats wrong with it

civic ridge
#

it not working for some :C

tough magnet
#

errors?

#

oh

#

I see

civic ridge
tough magnet
#
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

civic ridge
#

that one has error for some

peak perch
#

Vector3.new

#

also you would return the value so;
return Vector3.new ...

civic ridge
#

ohh

#

IT WORKS

#

WOOOOOO!

#

thank you izan

#

wait

tidal roverBOT
#

studio** You are now Level 11! **studio

civic ridge
#

They dont even spawn on the spawn area

#

and they stop after like 5 coins]

#

man

#

💀

gleaming flame
#

instead of getting the size of the spawn area you should be getting the position of the spawn area modified by its size