trying to make a coinflip script. It says the expected identifier.

``local x = math.random(1,2) local n = tonumber(v.PlayerGui.ScreenGui.TextBox.Text) script.Parent.MouseButton1Click:Connect(function() for i, v in pairs(game.Players:GetPlayers())do if v:FindFirstChild("leaderstats")then if v:FindFirstChild("PlayerGui")then if v.PlayerGui.ScreenGui.TextBox.Text == "0" then print("") else local n = tonumber(v.PlayerGui.ScreenGui.TextBox.Text) if v.leaderstats["Coins"].Value > n then

						if x == 1 then

							v.leaderstats["Coins"].Value = v.leaderstats["Coins"] + n
					else
						
								v.leaderstats["Coins"].Value = v.leaderstats["Coins"] -  n
								
									end
						end
					end
			end
		end
	end)
end)

end)