Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

1 comment

0

So you probably have multiple parts in Workspace called

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.