I have this coin script that will give player 10 coins when he collects a coin on the map. The problem is when the player collects the coin it gives every player in the game 10 coins and the coin disappears on all player's screen.
So far I have only 1 coin in the game for testing purposes I will make a different script later, but for now I need to understand how to give the player who collected the coin 10+ coins and make it only disappear on his screen.
LocalScript Inside StarterGui
local coin = game.Workspace.CoinGet -- Coin Part
local cash = script.Parent.Parent.ScreenGui.Cash
coin.Touched:Connect(function()
cash.Value = cash.Value + 10 -- Gives all players 10 coins.
coin:Destroy() -- Destroys for all players.
end)
