#Coins spawning
1 messages · Page 1 of 1 (latest)
** You are now Level 1! **
Ok give me a sec
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Force slow loading
task.wait(2)
-- Try multiple times to find folder
local coinFolder
repeat
coinFolder = ReplicatedStorage:FindFirstChild("CoinFolder")
task.wait(0.2)
until coinFolder
-- Try multiple times to find template
local coinTemplate
repeat
coinTemplate = coinFolder:FindFirstChild("CoinTemplate")
task.wait(0.2)
until coinTemplate
print("Coin system loaded successfully!")
local spawnArea = workspace
local maxCoins = 50
local spawnInterval = 5
while true do
if #spawnArea:GetChildren() < maxCoins then
local coin = coinTemplate:Clone()
coin.Parent = spawnArea
-- Make sure your coin has a PrimaryPart
coin:SetPrimaryPartCFrame(
CFrame.new(
math.random(-50, 50),
5,
math.random(-50, 50)
)
)
end
task.wait(spawnInterval)
end
I'm a complete noob my friend helped me out a bit
dud
use
I mean
Try
:PivotTo
Instead of
:SetPrimaryPartCFrame
I mean just leave the ( ) things
Only change this
Nothing happened
You shouldn’t use chat gpt if you don’t have the capability to fix its problems
Well spawn area is workspace and if there’s more than 50 things in workspace it just doesn’t work
So what if I told you I'm on studio lite 🥲
Yeah
Just do it
there’s explorer
On
Right
I thinkl
(Cuz i never tried using it)
Yeah there is
Show
How do Ik
Im running it rn
** You are now Level 2! **
Explain 😬
The problem is me ✌️
Move it into workspace?
Here
You want me to put that into the coin script?
listen
This is part of your script
all you have to do is
find this part and
Replace “ReplicatedStorage” to
“workspace”
K
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Force slow loading
task.wait(2)
-- Try multiple times to find folder
local coinFolder
repeat
coinFolder = workspace:FindFirstChild("CoinFolder")
task.wait(0.2)
until coinFolder
-- Try multiple times to find template
local coinTemplate
repeat
coinTemplate = coinFolder:FindFirstChild("CoinTemplate")
task.wait(0.2)
until coinTemplate
print("Coin system loaded successfully!")
local spawnArea = workspace
local maxCoins = 50
local spawnInterval = 5
while true do
if #coinfolder:GetChildren() < maxCoins then
local coin = coinTemplate:Clone()
coin.Parent = coinfolder
-- Make sure your coin has a PrimaryPart
coin:SetPrimaryPartCFrame(
CFrame.new(
math.random(-50, 50),
5,
math.random(-50, 50)
)
)
end
task.wait(spawnInterval)
end
I'm a complete noob my friend helped me out a bit
Try this
Did you just copy paste my script?
He fixed it or did he just copy paste
FIXED
Oh
So nothing is happening I think it's on me
The script is multiplying the ReplicatedStorage coin or the one in workspace
Oh mb
@grim galleon whats ur current code rn
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Force slow loading
task.wait(2)
-- Try multiple times to find folder
local coinFolder
repeat
coinFolder = workspace:FindFirstChild("CoinFolder")
task.wait(0.2)
until coinFolder
-- Try multiple times to find template
local coinTemplate
repeat
coinTemplate = coinFolder:FindFirstChild("CoinTemplate")
task.wait(0.2)
until coinTemplate
print("Coin system loaded successfully!")
local spawnArea = workspace
local maxCoins = 50
local spawnInterval = 5
while true do
if #coinfolder:GetChildren() < maxCoins then
local coin = coinTemplate:Clone()
coin.Parent = coinfolder
-- Make sure your coin has a PrimaryPart
coin:SetPrimaryPartCFrame(
CFrame.new(
math.random(-50, 50),
5,
math.random(-50, 50)
)
)
end
task.wait(spawnInterval)
end
Wdym
U just sent a screenshot CoinFolder is in replicatedstorage
Ok
Would it be easier if I added you and sent you the game (I'm using studio lite)
Why are u doing this inside Studio lite
Cause I don't have a computer
There is CoinFolder in ReplicatedStorage and workspace right?
Yes
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
task.wait(2)
local templateFolder = ReplicatedStorage:WaitForChild("CoinFolder")
local coinFolder = Workspace:WaitForChild("CoinFolder")
local coinTemplate = templateFolder:WaitForChild("CoinTemplate")
print("loaded")
local maxCoins = 50
local spawnInterval = 5
while true do
if #coinFolder:GetChildren() < maxCoins then
local coin = coinTemplate:Clone()
coin.Parent = coinFolder
coin.Position = Vector3.new(
math.random(-50, 50),
5,
math.random(-50, 50)
)
coin.Anchored = true
end
task.wait(spawnInterval)
end
Try this
Nothing. Do you want me to add you and send the game to you?
Yeah it printed
add a print inside the if statement
** You are now Level 3! **
Well I can still chat but I can't try out my script. I can chat on my other account if you want
@random parrot Is Studio Lite an app for mobile? How is it downloaded?
yes
Found the game. Looks swell.
Think diffirent from real roblox studio since is actually lite studio
swell.
** You are now Level 1! **
idk why that wouldnt work
are you sure coinsfolder isnt being filled up immediately blocking the loop or something
I gave up
never back down