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

When I copy my coin spinning script, the original coin, stops spinning how to fix??

Asked by
Synth_o 136
7 years ago

local coin2 = game.Workspace.coin enabled = true

script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and enabled then

    local player = game.Players:GetPlayerFromCharacter(hit.Parent)

    player.leaderstats.Points.Value = player.leaderstats.Points.Value + 1
    player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 1
    if hit then 
        coin:Destroy()
    end
    wait(1)
    enabled = true
end

end) Idk why the original coin stops spinning any help?

0
So you probably have multiple parts in Workspace called DankSponge 25 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

So you probably have multiple parts in workspace called "Coin" There are multiple ways around this, either name each individual coin a different name, like change "local coin2 = game.Workspace.coin" to local coin2 = game.Workspace.coin2 and name the other coin coin2, or use object values if you're familiar, or use a for loop to go through all the coins in workspace.

Ad

Answer this question