Probably something I missed but plz help
local event = game.ReplicatedStorage.Touch_Collect.RemoteEvent
local running = false
local sound = workspace.Collect_Coins_Area.sound
event.OnServerEvent:Connect(function(player)
if not running then running = true
local pieces = player.leaderstats:WaitForChild("Pieces")
local A = player:WaitForChild("PlayerGui").Coins.Coin.A
local F = A player:WaitForChild("PlayerGui").Coins.Coin.F
local coins = player.leaderstats:WaitForChild("Coins")
wait(0.1)
local value = pieces.Value
coins.Value = coins.Value +value
pieces.Value = pieces.Value - value
sound:Play()
wait(5)
running = false
end
end)

3 comments
does the output gives the line who makes the error?
Yeah
OutPut: ServerScriptService.Collect.Script:9: '=' expected near 'local'