i'm trying to make a simulator but the coin is in one place and not randomly spawning or cloning itself. give me examples of scripts to use
local Coin = game.ServerStorage.Coin --Location of the coin, recommend it be a part, mesh part, or part with mesh local Delay = 10 --Delay until spawns another local Y = 4 --The Y axis you want the coins to spawn in local Base = game.Workspace.Base --The base/the area you want it to spawn in local function GetPos() local X_Size = Base.Size.X local Z_Size = Base.Size.Z local Max_X_Pos = Base.Position.X + X_Size local Max_Z_Pos = Base.Position.Z + Z_Size local Min_X_Pos = Base.Position.X - X_Size local Min_Z_Pos = Base.Position.Z - Z_Size return math.random(Min_X_Pos, Max_X_Pos), math.random(Min_Z_Pos, Max_Z_Pos) end while true do local NewCoin = Coin:Clone() NewCoin.Parent = game.Workspace local X,Z = GetPos() --Get workable position NewCoin.Position = Vector3.new(X, Y, Z) --If this doesn't work, try CFrame wait(Delay) end
I haven't tested it, just came up with it. Hopefully it works!
First try to script it you're self you dont learn if you just copy scripts Ur gonna need The Clone() function and a loop
best of luck