Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How come my "Coin" that is in a model in Workspace isn't cloning?

Asked by 7 years ago

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?

0
Why are you setting the CloneCoin's position to the position it is already in ? farrizbb 465 — 7y
0
I want the coin to be cloned at it's position BlackOrange3343 2676 — 7y
0
But then it will go through the other coin BlackOrange3343 2676 — 7y
0
It may just be FilteringEnabled as the server does not see the function of "game.Players.PlayerAdded:connect(function()" if FE is on popeeyy 493 — 7y

Answer this question