This is my script;
local Coin = script.Parent local Owner = Coin.Parent:WaitForChild("Owner") local MiningSet = Coin.Parent game.Players.PlayerAdded:connect(function() wait(10) while true do wait(1) local CloneCoin = Coin:Clone() local Player = game.Players:FindFirstChild(Owner.Value) if not Player then MiningSet:Destroy() else wait(1) local CloneCoin = Coin:Clone() CloneCoin.Parent = game.Workspace CloneCoin.Anchored = false CloneCoin.CanCollide = true local CoinSpawn = game.Workspace:WaitForChild("MiningSet").Model.CoinSpawn CloneCoin.Position = Vector3.new(CloneCoin.Position) CloneCoin.Touched:connect(function(Hit) if Hit.Parent.Name == "Changer" then Player:WaitForChild("PlayerStatus").Coins.Value = Player:WaitForChild("PlayerStatus").Coins.Value + 1 end end) end end end)
There's no error but I can't figure out why my coin isn't spawning. This script is the coin that I want to be cloned. The coin is in a model. Can someone tell me how I would fix this or what I did wrong please?