Okay so, there is a script that spawns a coin from replicatedstorage into the workspace in a folder.
The script does work and duplicates a coin, but when it works again it moves/deletes the old coin and puts it in a new position so no more than 1 coin can be present, does anyone know why this is the case?
The script:
while wait(4) do
local coin = game.ReplicatedStorage.Coins:WaitForChild("World1")
local coins = game.Workspace.Coins
local a = math.random(-63,48)
local b = math.random(-32,40)
coin:Clone()
coin.Parent = game.Workspace.Coins.World1
coin.Position = Vector3.new(a,2.314,b)
coin.Script.Disabled = false
end
**EDIT
The coin comes out of replicatedstorage space. How do i keep it in replicated storage?
while wait(4) do
local coin = game.ReplicatedStorage.Coins:WaitForChild("World1")
local coins = game.Workspace.Coins
local a = math.random(-63,48)
local b = math.random(-32,40)
local coinCopy = coin:Clone()
coinCopy.Parent = game.ReplicatedStorage
coinCopy.Position = Vector3.new(a,2.314,b)
coinCopy.Script.Disabled = false
end
if you want the coins to spawn in workspace just change their parent